mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-12 08:25:44 +01:00
admin user and groups removed
This commit is contained in:
@@ -214,10 +214,6 @@ public class LDAPAuthenticationHandler implements AuthenticationHandler
|
||||
// read dynamic group attribute
|
||||
getGroups(userAttributes, groups);
|
||||
|
||||
// set admin
|
||||
user.setAdmin(isAdmin(user.getName(), groups));
|
||||
|
||||
// TODO: nsrole dn - admin role
|
||||
result = new AuthenticationResult(user, groups);
|
||||
}
|
||||
catch (NamingException ex)
|
||||
@@ -409,39 +405,6 @@ public class LDAPAuthenticationHandler implements AuthenticationHandler
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param userName
|
||||
* @param groups
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private boolean isAdmin(String userName, Set<String> groups)
|
||||
{
|
||||
boolean admin = false;
|
||||
|
||||
if (config.getAdminUserSet().contains(userName))
|
||||
{
|
||||
admin = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (String group : groups)
|
||||
{
|
||||
if (config.getAdminGroupSet().contains(group))
|
||||
{
|
||||
admin = true;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return admin;
|
||||
}
|
||||
|
||||
//~--- fields ---------------------------------------------------------------
|
||||
|
||||
/** Field description */
|
||||
|
||||
@@ -52,39 +52,6 @@ import javax.xml.bind.annotation.XmlRootElement;
|
||||
public class LDAPConfig
|
||||
{
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getAdminGroups()
|
||||
{
|
||||
return adminGroups;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getAdminNsroleDn()
|
||||
{
|
||||
return adminNsroleDn;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getAdminUsers()
|
||||
{
|
||||
return adminUsers;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
@@ -210,56 +177,6 @@ public class LDAPConfig
|
||||
return unitPeople;
|
||||
}
|
||||
|
||||
//~--- set methods ----------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param adminGroups
|
||||
*/
|
||||
public void setAdminGroups(String adminGroups)
|
||||
{
|
||||
this.adminGroups = adminGroups;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param adminUsers
|
||||
*/
|
||||
public void setAdminUsers(String adminUsers)
|
||||
{
|
||||
this.adminUsers = adminUsers;
|
||||
}
|
||||
|
||||
//~--- get methods ----------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
Set<String> getAdminGroupSet()
|
||||
{
|
||||
return split(adminGroups);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
Set<String> getAdminUserSet()
|
||||
{
|
||||
return split(adminUsers);
|
||||
}
|
||||
|
||||
//~--- methods --------------------------------------------------------------
|
||||
|
||||
/**
|
||||
@@ -287,18 +204,6 @@ public class LDAPConfig
|
||||
|
||||
//~--- fields ---------------------------------------------------------------
|
||||
|
||||
/** Field description */
|
||||
@XmlElement(name = "admin-groups")
|
||||
private String adminGroups = "scm-admin,dev-admin";
|
||||
|
||||
/** Field description */
|
||||
@XmlElement(name = "admin-nsrole-dn")
|
||||
private String adminNsroleDn = "cn=scm-admins-role,dc=scm-manager,dc=org";
|
||||
|
||||
/** Field description */
|
||||
@XmlElement(name = "admin-users")
|
||||
private String adminUsers = "admin,root";
|
||||
|
||||
/** Field description */
|
||||
@XmlElement(name = "attribute-name-fullname")
|
||||
private String attributeNameFullname = "cn";
|
||||
|
||||
@@ -35,23 +35,6 @@ registerGeneralConfigPanel({
|
||||
xtype : 'configForm',
|
||||
title : 'LDAP Authentication',
|
||||
items : [{
|
||||
xtype : 'textfield',
|
||||
fieldLabel : 'Admin NSRole DN',
|
||||
name : 'admin-nsrole-dn',
|
||||
allowBlank : true
|
||||
},{
|
||||
xtype : 'textfield',
|
||||
fieldLabel : 'Admin Groups',
|
||||
name : 'admin-groups',
|
||||
allowBlank : true
|
||||
}
|
||||
,{
|
||||
xtype : 'textfield',
|
||||
fieldLabel : 'Admin Users',
|
||||
name : 'admin-users',
|
||||
allowBlank : true
|
||||
}
|
||||
,{
|
||||
xtype : 'textfield',
|
||||
fieldLabel : 'Fullname Attribute Name',
|
||||
name : 'attribute-name-fullname',
|
||||
|
||||
Reference in New Issue
Block a user