use of org.ovirt.engine.core.common.businessentities.Permission in project ovirt-engine by oVirt.
the class SubTabUserPermissionView method initTable.
void initTable() {
getTable().enableColumnResizing();
PermissionTypeColumn typeColumn = new PermissionTypeColumn();
typeColumn.setContextMenuTitle(constants.typePermission());
// $NON-NLS-1$
getTable().addColumn(typeColumn, constants.empty(), "30px");
AbstractTextColumn<Permission> roleColumn = new AbstractTextColumn<Permission>() {
@Override
public String getValue(Permission object) {
return object.getRoleName();
}
};
roleColumn.makeSortable();
// $NON-NLS-1$
getTable().addColumn(roleColumn, constants.rolePermission(), "560px");
AbstractTextColumn<Permission> permissionColumn = new AbstractObjectNameColumn<Permission>() {
@Override
protected Object[] getRawValue(Permission object) {
return new Object[] { object.getObjectType(), object.getObjectName() };
}
};
permissionColumn.makeSortable();
// $NON-NLS-1$
getTable().addColumn(permissionColumn, constants.objectPermission(), "560px");
AbstractTextColumn<Permission> inheritedColumn = new AbstractGroupNameColumn<Permission>() {
@Override
protected Object[] getRawValue(Permission object) {
return new Object[] { getDetailModel().getEntity(), object.getAdElementId(), object.getOwnerName() };
}
};
inheritedColumn.makeSortable();
// $NON-NLS-1$
getTable().addColumn(inheritedColumn, constants.inheritedPermission(), "560px");
}
use of org.ovirt.engine.core.common.businessentities.Permission in project ovirt-engine by oVirt.
the class AddPermissionCommand method getPermissionCheckSubjects.
@Override
public List<PermissionSubject> getPermissionCheckSubjects() {
Permission permission = getParameters().getPermission();
List<PermissionSubject> permissionsSubject = new ArrayList<>();
permissionsSubject.add(new PermissionSubject(permission.getObjectId(), permission.getObjectType(), getActionType().getActionGroup()));
initUserAndGroupData();
// user from the directory service
if ((getParameters().getUser() != null && dbUser == null) || (getParameters().getGroup() != null && dbGroup == null)) {
permissionsSubject.add(new PermissionSubject(permission.getObjectId(), permission.getObjectType(), ActionGroup.ADD_USERS_AND_GROUPS_FROM_DIRECTORY));
}
return permissionsSubject;
}
use of org.ovirt.engine.core.common.businessentities.Permission in project ovirt-engine by oVirt.
the class RemoveUserCommand method executeCommand.
@Override
protected void executeCommand() {
// Get the identifier of the user to be removed from the parameters:
Guid id = getParameters().getId();
// TODO: This should be done without invoking the command to avoid the overhead.
for (Permission permission : permissionDao.getAllDirectPermissionsForAdElement(id)) {
PermissionsOperationsParameters tempVar = new PermissionsOperationsParameters(permission);
tempVar.setShouldBeLogged(false);
runInternalActionWithTasksContext(ActionType.RemovePermission, tempVar);
}
// Delete the user itself:
dbUserDao.remove(id);
setSucceeded(true);
}
use of org.ovirt.engine.core.common.businessentities.Permission in project ovirt-engine by oVirt.
the class BackendAssignedRolesResourceTest method getEntity.
@Override
protected Permission getEntity(int index) {
Permission permission = new Permission();
permission.setId(GUIDS[(index + 1) % 3]);
permission.setAdElementId(GUIDS[0]);
permission.setRoleId(GUIDS[index]);
permission.setObjectType(VdcObjectType.System);
return permission;
}
use of org.ovirt.engine.core.common.businessentities.Permission in project ovirt-engine by oVirt.
the class MultiLevelAdministrationHandler method addPermission.
public void addPermission(Guid userId, Guid entityId, PredefinedRoles role, VdcObjectType objectType) {
Permission perms = new Permission();
perms.setAdElementId(userId);
perms.setObjectType(objectType);
perms.setObjectId(entityId);
perms.setRoleId(role.getId());
addPermission(perms);
}
Aggregations