| | |
| | | import com.gitblit.Constants; |
| | | import com.gitblit.Constants.AccountType; |
| | | import com.gitblit.Constants.AuthenticationType; |
| | | import com.gitblit.Constants.Role; |
| | | import com.gitblit.IStoredSettings; |
| | | import com.gitblit.Keys; |
| | | import com.gitblit.auth.AuthenticationProvider; |
| | |
| | | return (team != null && team.isLocalTeam()) || findProvider(team).supportsTeamMembershipChanges(); |
| | | } |
| | | |
| | | /** |
| | | * Returns true if the user's role can be changed. |
| | | * |
| | | * @param user |
| | | * @return true if the user's role can be changed |
| | | */ |
| | | @Override |
| | | public boolean supportsRoleChanges(UserModel user, Role role) { |
| | | return (user != null && user.isLocalAccount()) || findProvider(user).supportsRoleChanges(user, role); |
| | | } |
| | | |
| | | /** |
| | | * Returns true if the team's role can be changed. |
| | | * |
| | | * @param user |
| | | * @return true if the team's role can be changed |
| | | */ |
| | | @Override |
| | | public boolean supportsRoleChanges(TeamModel team, Role role) { |
| | | return (team != null && team.isLocalTeam()) || findProvider(team).supportsRoleChanges(team, role); |
| | | } |
| | | |
| | | protected AuthenticationProvider findProvider(UserModel user) { |
| | | for (AuthenticationProvider provider : authenticationProviders) { |
| | | if (provider.getAccountType().equals(user.accountType)) { |