| | |
| | | public boolean canFork;
|
| | | public boolean canCreate;
|
| | | public boolean excludeFromFederation;
|
| | | public boolean disabled;
|
| | | // retained for backwards-compatibility with RPC clients
|
| | | @Deprecated
|
| | | public final Set<String> repositories = new HashSet<String>();
|
| | |
| | | return canAdmin() || model.isUsersPersonalRepository(username) || model.isOwner(username);
|
| | | }
|
| | |
|
| | | public boolean canEdit(TicketModel ticket, RepositoryModel repository) {
|
| | | return isAuthenticated() &&
|
| | | (canPush(repository)
|
| | | || (ticket != null && username.equals(ticket.responsible))
|
| | | || (ticket != null && username.equals(ticket.createdBy)));
|
| | | }
|
| | |
|
| | | public boolean canAdmin(TicketModel ticket, RepositoryModel repository) {
|
| | | return isAuthenticated() &&
|
| | | (canPush(repository)
|
| | | || ticket != null && username.equals(ticket.responsible));
|
| | | }
|
| | |
|
| | | public boolean canReviewPatchset(RepositoryModel model) {
|
| | | return isAuthenticated() && canClone(model);
|
| | | }
|
| | |
|
| | | public boolean canApprovePatchset(RepositoryModel model) {
|
| | | return isAuthenticated() && canPush(model);
|
| | | }
|
| | |
|
| | | public boolean canVetoPatchset(RepositoryModel model) {
|
| | | return isAuthenticated() && canPush(model);
|
| | | }
|
| | |
|
| | | /**
|
| | | * This returns true if the user has fork privileges or the user has fork
|
| | | * privileges because of a team membership.
|
| | |
| | | return false;
|
| | | }
|
| | |
|
| | | public boolean isAuthenticated() {
|
| | | return !UserModel.ANONYMOUS.equals(this) && isAuthenticated;
|
| | | }
|
| | |
|
| | | public boolean isTeamMember(String teamname) {
|
| | | for (TeamModel team : teams) {
|
| | | if (team.name.equalsIgnoreCase(teamname)) {
|