summaryrefslogtreecommitdiffstats
path: root/src/com/gitblit/models/TeamModel.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/gitblit/models/TeamModel.java')
-rw-r--r--src/com/gitblit/models/TeamModel.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/com/gitblit/models/TeamModel.java b/src/com/gitblit/models/TeamModel.java
index 4c3a8427..9ba2f669 100644
--- a/src/com/gitblit/models/TeamModel.java
+++ b/src/com/gitblit/models/TeamModel.java
@@ -97,7 +97,7 @@ public class TeamModel implements Serializable, Comparable<TeamModel> {
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;
@@ -130,6 +130,18 @@ public class TeamModel implements Serializable, Comparable<TeamModel> {
}
/**
+ * Returns true if the team has an explicitly specified access permission for
+ * this repository.
+ *
+ * @param name
+ * @return if the team 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: