| | |
| | |
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | public static final UserModel ANONYMOUS = new UserModel();
|
| | | |
| | | // field names are reflectively mapped in EditUser page
|
| | | public String username;
|
| | | public String password;
|
| | |
| | | public UserModel(String username) {
|
| | | this.username = username;
|
| | | this.isAuthenticated = true;
|
| | | }
|
| | |
|
| | | private UserModel() {
|
| | | this.username = "anonymous";
|
| | | this.isAuthenticated = false;
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | return false;
|
| | | }
|
| | |
|
| | | public boolean canViewRepository(RepositoryModel repository) {
|
| | | if (canAdmin) {
|
| | | return true;
|
| | | }
|
| | | if (repository.accessRestriction.atLeast(AccessRestrictionType.VIEW)) {
|
| | | return canAccessRepository(repository);
|
| | | }
|
| | | return true;
|
| | | }
|
| | | |
| | | public boolean canForkRepository(RepositoryModel repository) {
|
| | | if (canAdmin) {
|
| | | return true;
|