class ProjectController {

    public boolean canDeleteProject(final WorkspaceProject workspaceProject) {
        final boolean securityPermission = authorizationManager.authorize(workspaceProject.getRepository(),
                                                                          RepositoryAction.DELETE,
                                                                          user);

        return securityPermission
                || userIsAtLeast(ContributorType.OWNER,
                                 workspaceProject.getRepository().getContributors())
                || userIsAtLeast(ContributorType.OWNER,
                                 workspaceProject.getOrganizationalUnit().getContributors());
    }

    @Inject public  ProjectController(final AuthorizationManager authorizationManager,
                             final User user,
                             final Caller<ProjectPermissionsService> projectPermissionsService,
                             final Promises promises);

}