dynamicRoleDAO.deleteRoles(applicationId);
}
@Override
public void assignPermissions(String roleId, Set<IPermissionMetaInfo> permissions) throws ObjectNotFoundException {
DynamicRoleMetaInfo role = (DynamicRoleMetaInfo) getDynamicRole(roleId);
if (role == null) {
throw new ObjectNotFoundException("Dynamic role is not found", roleId); //$NON-NLS-1$
}
String modelId = role.getModelId();
List<IRoleInstanceMetaInfo> instances = roleInstanceService.getRoleInstances(modelId, role.getId());
Set<PermissionRole> oldPermissions = role.getPermissionRoles();
if (permissions == null) {
oldPermissions.clear();
dynamicRoleDAO.saveDynamicRole(role);
return;
}