Commits

Anonymous committed 48bdecf

admin user and groups removed

  • Participants
  • Parent commits 34449f1

Comments (0)

Files changed (3)

File plugins/scm-auth-ldap-plugin/src/main/java/sonia/scm/auth/ldap/LDAPAuthenticationHandler.java

             // 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)
     }
   }
 
-  /**
-   * 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 */

File plugins/scm-auth-ldap-plugin/src/main/java/sonia/scm/auth/ldap/LDAPConfig.java

    *
    * @return
    */
-  public String getAdminGroups()
-  {
-    return adminGroups;
-  }
-
-  /**
-   * Method description
-   *
-   *
-   * @return
-   */
-  public String getAdminNsroleDn()
-  {
-    return adminNsroleDn;
-  }
-
-  /**
-   * Method description
-   *
-   *
-   * @return
-   */
-  public String getAdminUsers()
-  {
-    return adminUsers;
-  }
-
-  /**
-   * Method description
-   *
-   *
-   * @return
-   */
   public String getAttributeNameFullname()
   {
     return attributeNameFullname;
     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 --------------------------------------------------------------
 
   /**
   //~--- 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";
 

File plugins/scm-auth-ldap-plugin/src/main/resources/sonia/scm/auth/ldap/sonia.ldap.js

   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',
     allowBlank : true