Package org.rhq.core.domain.resource.composite

Examples of org.rhq.core.domain.resource.composite.ResourcePermission


                                .getAttributeAsObject("resourceComposite");
                            Resource res = resComposite.getResource();
                            if (!(isEnabled = res.getResourceType().isDeletable())) {
                                break;
                            }
                            ResourcePermission resPermission = resComposite.getResourcePermission();
                            if (!(isEnabled = resPermission.isDeleteResource())) {
                                break;
                            }
                        }
                    }
                    return isEnabled;
View Full Code Here


    public static ResourcePermission getResourcePermission() {
        AuthorizationManagerLocal authorizationManager = LookupUtil.getAuthorizationManager();
        Subject subject = EnterpriseFacesContextUtility.getSubject();
        Resource resource = EnterpriseFacesContextUtility.getResource();
        Set<Permission> resourcePerms = authorizationManager.getImplicitResourcePermissions(subject, resource.getId());
        return new ResourcePermission(resourcePerms);
    }
View Full Code Here

     */
    public static ResourcePermission getGroupPermission(int groupId) {
        AuthorizationManagerLocal authorizationManager = LookupUtil.getAuthorizationManager();
        Subject subject = EnterpriseFacesContextUtility.getSubject();
        Set<Permission> groupPerms = authorizationManager.getImplicitGroupPermissions(subject, groupId);
        return new ResourcePermission(groupPerms);
    }
View Full Code Here

                facets = resourceTypeManager.getResourceFacets(type.getId());
            }
            ResourceGroupComposite composite = new ResourceGroupComposite(explicitCount, explicitDown, explicitUnknown,
                explicitDisabled, implicitCount, implicitDown, implicitUnknown, implicitDisabled, group, facets);
            Set<Permission> perms = authorizationManager.getImplicitGroupPermissions(subject, group.getId());
            composite.setResourcePermission(new ResourcePermission(perms));
            results.add(composite);
        }

        return new PageList<ResourceGroupComposite>(results, (int) count, pc);
    }
View Full Code Here

                ResourceGroup group = groupComposite.getResourceGroup();
                Subject groupOwner = group.getSubject();
                if (null != groupOwner) {
                    // private group, we need to set the group resource permissions since we couldn't do it in
                    // the projection.
                    groupComposite.setResourcePermission(new ResourcePermission(authorizationManager
                        .getExplicitGroupPermissions(groupOwner, group.getId())));
                } else {
                    throw new IllegalStateException("Unexpected group, not subject owned: " + groupComposite);
                }
            }
View Full Code Here

    public ResourceUIBean(Resource resource, Subject subject) {
        this.resource = resource;
        this.parent = resourceManager.getParentResource(this.resource.getId());
        Set<Permission> resourcePerms = this.authorizationManager.getImplicitResourcePermissions(subject, this.resource
            .getId());
        this.permissions = new ResourcePermission(resourcePerms);
        this.facets = this.resourceTypeManager.getResourceFacets(getResourceType().getId());
        //this.tabs = this.perspectiveManager.getResourceTabs(subject, this.resource);

        //parent can be viewed by user only if he is allowed to see it
        if (parent != null)
View Full Code Here

        this.count = upCount + downCount;
        this.availability = resourceGroupComposite.getExplicitAvail();
        this.subject = subject;
        Set<Permission> permissions = LookupUtil.getAuthorizationManager().getImplicitGroupPermissions(subject,
            this.resourceGroup.getId());
        this.permissions = new ResourcePermission(permissions);
        if (this.resourceGroup.getGroupCategory() == GroupCategory.COMPATIBLE) {
            this.facets = this.resourceTypeManager.getResourceFacets(this.resourceGroup.getResourceType().getId());
        }
    }
View Full Code Here

    public ResourceGroupComposite(Long explicitCount, Long explicitDown, Long explicitUnknown, Long explicitDisabled,
        Long implicitCount, Long implicitDown, Long implicitUnknown, Long implicitDisabled, ResourceGroup resourceGroup) {

        this(explicitCount, explicitDown, explicitUnknown, explicitDisabled, implicitCount, implicitDown,
            implicitUnknown, implicitDisabled,
            resourceGroup, null, new ResourcePermission());
    }
View Full Code Here

        Number control, Number alert, Number event, Number configureRead, Number configureWrite, Number content,
        Number createChildResources, Number deleteResources, Number drift) {

        this(explicitCount, explicitDown, explicitUnknown, explicitDisabled, implicitCount, implicitDown,
            implicitUnknown, implicitDisabled,
            resourceGroup, null, new ResourcePermission(measure.intValue() > 0, inventory.intValue() > 0,
                control.intValue() > 0, alert.intValue() > 0, event.intValue() > 0, configureRead.intValue() > 0,
                configureWrite.intValue() > 0, content.intValue() > 0, createChildResources.intValue() > 0,
                deleteResources.intValue() > 0, drift.intValue() > 0));
    }
View Full Code Here

        Long implicitCount, Long implicitDown, Long implicitUnknown, Long implicitDisabled,
        ResourceGroup resourceGroup, ResourceFacets facets) {

        this(explicitCount, explicitDown, explicitUnknown, explicitDisabled, implicitCount, implicitDown,
            implicitUnknown, implicitDisabled,
            resourceGroup, facets, new ResourcePermission());
    }
View Full Code Here

TOP

Related Classes of org.rhq.core.domain.resource.composite.ResourcePermission

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.