mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-03-07 21:00:54 +01:00
remove duplicated admin group and user configuration
This commit is contained in:
@@ -137,7 +137,6 @@ public class PAMAuthenticationHandler implements AuthenticationHandler
|
||||
{
|
||||
User user = new User(username);
|
||||
|
||||
user.setAdmin(isAdmin(unixUser));
|
||||
result = new AuthenticationResult(user, unixUser.getGroups());
|
||||
}
|
||||
}
|
||||
@@ -229,40 +228,6 @@ public class PAMAuthenticationHandler implements AuthenticationHandler
|
||||
this.config = config;
|
||||
}
|
||||
|
||||
//~--- get methods ----------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param unixUser
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private boolean isAdmin(UnixUser unixUser)
|
||||
{
|
||||
boolean admin = false;
|
||||
|
||||
if (config.getAdminUserSet().contains(unixUser.getUserName()))
|
||||
{
|
||||
admin = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (String group : unixUser.getGroups())
|
||||
{
|
||||
if (config.getAdminGroupSet().contains(group))
|
||||
{
|
||||
admin = true;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return admin;
|
||||
}
|
||||
|
||||
//~--- fields ---------------------------------------------------------------
|
||||
|
||||
/** Field description */
|
||||
|
||||
Reference in New Issue
Block a user