import com.gitblit.Constants.AccountType;\r
import com.gitblit.Constants.PermissionType;\r
import com.gitblit.Constants.RegistrantType;\r
-import com.gitblit.Constants.Unused;\r
import com.gitblit.utils.StringUtils;\r
\r
/**\r
this.accountType = AccountType.LOCAL;\r
}\r
\r
- /**\r
- * @use hasRepositoryPermission\r
- * @param name\r
- * @return\r
- */\r
- @Deprecated\r
- @Unused\r
- public boolean hasRepository(String name) {\r
- return hasRepositoryPermission(name);\r
- }\r
-\r
- @Deprecated\r
- @Unused\r
- public void addRepository(String name) {\r
- addRepositoryPermission(name);\r
- }\r
-\r
- @Deprecated\r
- @Unused\r
- public void addRepositories(Collection<String> names) {\r
- addRepositoryPermissions(names);\r
- }\r
-\r
- @Deprecated\r
- @Unused\r
- public void removeRepository(String name) {\r
- removeRepositoryPermission(name);\r
- }\r
-\r
-\r
/**\r
* Returns a list of repository permissions for this team.\r
*\r
import com.gitblit.Constants.AuthorizationControl;\r
import com.gitblit.Constants.PermissionType;\r
import com.gitblit.Constants.RegistrantType;\r
-import com.gitblit.Constants.Unused;\r
import com.gitblit.utils.ArrayUtils;\r
import com.gitblit.utils.ModelUtils;\r
import com.gitblit.utils.StringUtils;\r
|| accountType.isLocal();\r
}\r
\r
- /**\r
- * This method does not take into consideration Ownership where the\r
- * administrator has not explicitly granted access to the owner.\r
- *\r
- * @param repositoryName\r
- * @return\r
- */\r
- @Deprecated\r
- public boolean canAccessRepository(String repositoryName) {\r
- return canAdmin() || repositories.contains(repositoryName.toLowerCase())\r
- || hasTeamAccess(repositoryName);\r
- }\r
-\r
- @Deprecated\r
- @Unused\r
- public boolean canAccessRepository(RepositoryModel repository) {\r
- boolean isOwner = repository.isOwner(username);\r
- boolean allowAuthenticated = isAuthenticated && AuthorizationControl.AUTHENTICATED.equals(repository.authorizationControl);\r
- return canAdmin() || isOwner || repositories.contains(repository.name.toLowerCase())\r
- || hasTeamAccess(repository.name) || allowAuthenticated;\r
- }\r
-\r
- @Deprecated\r
- @Unused\r
- public boolean hasTeamAccess(String repositoryName) {\r
- for (TeamModel team : teams) {\r
- if (team.hasRepositoryPermission(repositoryName)) {\r
- return true;\r
- }\r
- }\r
- return false;\r
- }\r
-\r
- @Deprecated\r
- @Unused\r
- public boolean hasRepository(String name) {\r
- return hasRepositoryPermission(name);\r
- }\r
-\r
- @Deprecated\r
- @Unused\r
- public void addRepository(String name) {\r
- addRepositoryPermission(name);\r
- }\r
-\r
- @Deprecated\r
- @Unused\r
- public void removeRepository(String name) {\r
- removeRepositoryPermission(name);\r
- }\r
-\r
/**\r
* Returns a list of repository permissions for this user exclusive of\r
* permissions inherited from team memberships.\r
return nameVerified && emailVerified;\r
}\r
\r
- @Deprecated\r
- public boolean hasBranchPermission(String repositoryName, String branch) {\r
- // Default UserModel doesn't implement branch-level security. Other Realms (i.e. Gerrit) may override this method.\r
- return hasRepositoryPermission(repositoryName) || hasTeamRepositoryPermission(repositoryName);\r
- }\r
-\r
public boolean isMyPersonalRepository(String repository) {\r
String projectPath = StringUtils.getFirstPathElement(repository);\r
return !StringUtils.isEmpty(projectPath) && projectPath.equalsIgnoreCase(getPersonalPath());\r