Search in sources :

Example 6 with RoleValue

use of net.jforum.security.RoleValue in project jforum2 by rafaelsteil.

the class ForumAction method addRole.

private void addRole(PermissionControl pc, String roleName, int forumId, String[] groups) {
    Role role = new Role();
    role.setName(roleName);
    for (int i = 0; i < groups.length; i++) {
        int groupId = Integer.parseInt(groups[i]);
        RoleValueCollection roleValues = new RoleValueCollection();
        RoleValue rv = new RoleValue();
        rv.setValue(Integer.toString(forumId));
        roleValues.add(rv);
        pc.addRoleValue(groupId, role, roleValues);
    }
}
Also used : Role(net.jforum.security.Role) RoleValue(net.jforum.security.RoleValue) RoleValueCollection(net.jforum.security.RoleValueCollection)

Aggregations

RoleValue (net.jforum.security.RoleValue)6 SQLException (java.sql.SQLException)3 DatabaseException (net.jforum.exceptions.DatabaseException)3 Role (net.jforum.security.Role)3 PreparedStatement (java.sql.PreparedStatement)2 ResultSet (java.sql.ResultSet)2 Iterator (java.util.Iterator)2 RoleValueCollection (net.jforum.security.RoleValueCollection)2 GroupSecurityDAO (net.jforum.dao.GroupSecurityDAO)1 Category (net.jforum.entities.Category)1 PermissionControl (net.jforum.security.PermissionControl)1 RoleCollection (net.jforum.security.RoleCollection)1