Package org.apache.cloudstack.api

Examples of org.apache.cloudstack.api.InternalIdentity


                if (_domainDao.isChildDomain(scopeId, entity.getDomainId())) {
                    return true;
                }
            } else if (scope.equals(PermissionScope.RESOURCE.name())) {
                if (entity instanceof InternalIdentity) {
                    InternalIdentity entityWithId = (InternalIdentity) entity;
                    if(scopeId.equals(entityWithId.getId())){
                        return true;
                    }
                }
            }
        } else if (scopeId == null || scopeId.equals(new Long(IAMPolicyPermission.PERMISSION_SCOPE_ID_CURRENT_CALLER))) {
View Full Code Here


    public Long getPermissionScopeId(String scope, String entityType, String scopeId) {
        if (scopeId.equals("-1")) {
            return -1L;
        }
        PermissionScope permScope = PermissionScope.valueOf(scope);
        InternalIdentity entity = null;
        switch (permScope) {
        case DOMAIN:
            entity = _domainDao.findByUuid(scopeId);
            break;
        case ACCOUNT:
            entity = _accountDao.findByUuid(scopeId);
            break;
        case RESOURCE:
            Class<?> clazz = s_typeMap.get(entityType);
            entity = (InternalIdentity)_entityMgr.findByUuid(clazz, scopeId);
        }

        if (entity != null) {
            return entity.getId();
        }
        throw new InvalidParameterValueException("Unable to find scopeId " + scopeId + " with scope " + scope + " and type " + entityType);
    }
View Full Code Here

TOP

Related Classes of org.apache.cloudstack.api.InternalIdentity

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.