Roy Golan has posted comments on this change.
Change subject: core: use instance type in addVm + permissions
......................................................................
Patch Set 13: Looks good to me, but someone else must approve
(5 inline comments)
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmCommand.java
Line 139: }
Line 140:
Line 141: protected ImageType getImageType() {
Line 142: if (imageType == null && imageTypeId != null) {
Line 143: imageType =
getVmTemplateDAO().getImageType(imageTypeId.getValue());
same about boolean method
Line 144: }
Line 145: return imageType;
Line 146: }
Line 147:
Line 808: protected boolean checkPermissions(final List<PermissionSubject>
permSubjects) {
Line 809: for (PermissionSubject permSubject : permSubjects) {
Line 810: // if user is using instance type, then create_instance
on the cluster is enough
Line 811: if (permSubject.getObjectType() ==
VdcObjectType.VdsGroups && instanceTypeId != null) {
Line 812:
permSubject.setActionGroup(ActionGroup.CREATE_INSTANCE);
we should'nt mess with permSubjects here- its the responsibility of
getPermissionSubjects . Wasn't it simpler to do it there?
Line 813: if (checkSinglePermission(permSubject,
getReturnValue().getCanDoActionMessages())) {
Line 814: continue;
Line 815: }
Line 816:
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/PredefinedRoles.java
Line 21: VM_CREATOR(new Guid("DEF0000A-0000-0000-0000-DEF00000000D")),
Line 22: TEMPLATE_CREATOR(new Guid("DEF0000A-0000-0000-0000-DEF00000000E")),
Line 23: TEMPLATE_OWNER(new Guid("DEF0000A-0000-0000-0000-DEF00000000F")),
Line 24: NETWORK_USER(new Guid("DEF0000A-0000-0000-0000-DEF000000010")),
Line 25: INSTANCE_CREATOR(new Guid("DEF00011-0000-0000-0000-DEF000000011")),
INSTANCE_TYPE_CREATOR and INSTANCE_TYPE_OPERATOR
INSTANCE_CREATOR is a bit missleading
Line 26: INSTANCE_OPERATOR(new
Guid("DEF00012-0000-0000-0000-DEF000000012"));
Line 27:
Line 28: private Guid id;
Line 29:
....................................................
File
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/ActionGroup.java
Line 39: * Admin role can specify destinationVdsId to override default
target host.
Line 40: */
Line 41: EDIT_ADMIN_VM_PROPERTIES(15, RoleType.ADMIN, VdcObjectType.VM,
true, ApplicationMode.VirtOnly),
Line 42:
Line 43: CREATE_INSTANCE(16, RoleType.USER, VdcObjectType.VM, false,
ApplicationMode.VirtOnly),
CRATE_INSTANCE_TYPE
INSTANCE is misleading and not symetric with the object name
Line 44:
Line 45: // host (vds) actions groups
Line 46: CREATE_HOST(100, RoleType.ADMIN, VdcObjectType.VDS, true),
Line 47: EDIT_HOST_CONFIGURATION(101, RoleType.ADMIN, VdcObjectType.VDS,
true),
....................................................
File
backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/model/PermitType.java
Line 31: MANIPULATE_VM_SNAPSHOTS,
Line 32: RECONNECT_TO_VM,
Line 33: CHANGE_VM_CUSTOM_PROPERTIES,
Line 34: EDIT_ADMIN_VM_PROPERTIES,
Line 35: CREATE_INSTANCE,
CRAETE_INSTANCE_TYPE
Line 36: // host (vds) actions groups
Line 37: CREATE_HOST,
Line 38: EDIT_HOST_CONFIGURATION,
Line 39: DELETE_HOST,
--
To view, visit http://gerrit.ovirt.org/12281
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: If9058907d1021b09981671e905defb91ed645d65
Gerrit-PatchSet: 13
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Omer Frenkel <[email protected]>
Gerrit-Reviewer: Omer Frenkel <[email protected]>
Gerrit-Reviewer: Roy Golan <[email protected]>
Gerrit-Reviewer: Tomas Jelinek <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches