Search in sources :

Example 1 with XXRoleRefRoleDao

use of org.apache.ranger.db.XXRoleRefRoleDao in project ranger by apache.

the class RoleRefUpdater method cleanupRefTables.

public Boolean cleanupRefTables(RangerRole rangerRole) {
    final Long roleId = rangerRole.getId();
    if (roleId == null) {
        return false;
    }
    XXRoleRefUserDao xRoleUserDao = daoMgr.getXXRoleRefUser();
    XXRoleRefGroupDao xRoleGroupDao = daoMgr.getXXRoleRefGroup();
    XXRoleRefRoleDao xRoleRoleDao = daoMgr.getXXRoleRefRole();
    for (XXRoleRefUser xxRoleRefUser : xRoleUserDao.findByRoleId(roleId)) {
        xRoleUserDao.remove(xxRoleRefUser);
    }
    for (XXRoleRefGroup xxRoleRefGroup : xRoleGroupDao.findByRoleId(roleId)) {
        xRoleGroupDao.remove(xxRoleRefGroup);
    }
    for (XXRoleRefRole xxRoleRefRole : xRoleRoleDao.findByRoleId(roleId)) {
        xRoleRoleDao.remove(xxRoleRefRole);
    }
    return true;
}
Also used : XXRoleRefRoleDao(org.apache.ranger.db.XXRoleRefRoleDao) XXRoleRefUser(org.apache.ranger.entity.XXRoleRefUser) XXRoleRefUserDao(org.apache.ranger.db.XXRoleRefUserDao) XXRoleRefRole(org.apache.ranger.entity.XXRoleRefRole) XXRoleRefGroup(org.apache.ranger.entity.XXRoleRefGroup) XXRoleRefGroupDao(org.apache.ranger.db.XXRoleRefGroupDao)

Aggregations

XXRoleRefGroupDao (org.apache.ranger.db.XXRoleRefGroupDao)1 XXRoleRefRoleDao (org.apache.ranger.db.XXRoleRefRoleDao)1 XXRoleRefUserDao (org.apache.ranger.db.XXRoleRefUserDao)1 XXRoleRefGroup (org.apache.ranger.entity.XXRoleRefGroup)1 XXRoleRefRole (org.apache.ranger.entity.XXRoleRefRole)1 XXRoleRefUser (org.apache.ranger.entity.XXRoleRefUser)1