summaryrefslogtreecommitdiffstats
path: root/src/com/gitblit/models
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/gitblit/models')
-rw-r--r--src/com/gitblit/models/UserModel.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/com/gitblit/models/UserModel.java b/src/com/gitblit/models/UserModel.java
index 0ede8787..25787a15 100644
--- a/src/com/gitblit/models/UserModel.java
+++ b/src/com/gitblit/models/UserModel.java
@@ -86,6 +86,16 @@ public class UserModel implements Principal, Serializable, Comparable<UserModel>
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;