summaryrefslogtreecommitdiffstats
path: root/src/com/gitblit/models/UserModel.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/gitblit/models/UserModel.java')
-rw-r--r--src/com/gitblit/models/UserModel.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/com/gitblit/models/UserModel.java b/src/com/gitblit/models/UserModel.java
index 77337043..97430bfe 100644
--- a/src/com/gitblit/models/UserModel.java
+++ b/src/com/gitblit/models/UserModel.java
@@ -137,7 +137,7 @@ public class UserModel implements Principal, Serializable, Comparable<UserModel>
public List<RegistrantAccessPermission> getRepositoryPermissions() {
List<RegistrantAccessPermission> list = new ArrayList<RegistrantAccessPermission>();
for (Map.Entry<String, AccessPermission> entry : permissions.entrySet()) {
- list.add(new RegistrantAccessPermission(entry.getKey(), entry.getValue(), RegistrantType.REPOSITORY));
+ list.add(new RegistrantAccessPermission(entry.getKey(), entry.getValue(), true, RegistrantType.REPOSITORY));
}
Collections.sort(list);
return list;
@@ -170,6 +170,18 @@ public class UserModel implements Principal, Serializable, Comparable<UserModel>
}
/**
+ * Returns true if the user has an explicitly specified access permission for
+ * this repository.
+ *
+ * @param name
+ * @return if the user has an explicitly specified access permission
+ */
+ public boolean hasExplicitRepositoryPermission(String name) {
+ String repository = AccessPermission.repositoryFromRole(name).toLowerCase();
+ return permissions.containsKey(repository);
+ }
+
+ /**
* Adds a repository permission to the team.
* <p>
* Role may be formatted as: