Search in sources :

Example 1 with GetPermissionsForObjectParameters

use of org.ovirt.engine.core.common.queries.GetPermissionsForObjectParameters in project ovirt-engine by oVirt.

the class PermissionListModel method syncSearch.

@Override
protected void syncSearch() {
    VdcObjectType objType = getObjectType();
    GetPermissionsForObjectParameters tempVar = new GetPermissionsForObjectParameters();
    tempVar.setObjectId(getEntityGuid());
    tempVar.setVdcObjectType(objType);
    tempVar.setDirectOnly(false);
    tempVar.setRefresh(getIsQueryFirstTime());
    tempVar.setAllUsersWithPermission(getAllUsersWithPermission());
    super.syncSearch(QueryType.GetPermissionsForObject, tempVar);
}
Also used : VdcObjectType(org.ovirt.engine.core.common.VdcObjectType) GetPermissionsForObjectParameters(org.ovirt.engine.core.common.queries.GetPermissionsForObjectParameters)

Example 2 with GetPermissionsForObjectParameters

use of org.ovirt.engine.core.common.queries.GetPermissionsForObjectParameters in project ovirt-engine by oVirt.

the class QuotaPermissionListModel method syncSearch.

@Override
protected void syncSearch() {
    GetPermissionsForObjectParameters tempVar = new GetPermissionsForObjectParameters();
    tempVar.setObjectId(getEntityGuid());
    tempVar.setVdcObjectType(getObjectType());
    tempVar.setDirectOnly(false);
    tempVar.setRefresh(getIsQueryFirstTime());
    tempVar.setRefresh(getIsQueryFirstTime());
    Frontend.getInstance().runQuery(QueryType.GetPermissionsForObject, tempVar, new AsyncQuery<QueryReturnValue>(returnValue -> {
        ArrayList<Permission> list = returnValue.getReturnValue();
        ArrayList<Permission> newList = new ArrayList<>();
        for (Permission permission : list) {
            if (!permission.getRoleId().equals(ApplicationGuids.quotaConsumer.asGuid())) {
                newList.add(permission);
            }
        }
        setItems(newList);
    }));
    setIsQueryFirstTime(false);
}
Also used : AdElementListModel(org.ovirt.engine.ui.uicommonweb.models.users.AdElementListModel) QueryType(org.ovirt.engine.core.common.queries.QueryType) QueryReturnValue(org.ovirt.engine.core.common.queries.QueryReturnValue) PermissionListModel(org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel) Inject(com.google.inject.Inject) HelpTag(org.ovirt.engine.ui.uicommonweb.help.HelpTag) Quota(org.ovirt.engine.core.common.businessentities.Quota) GetPermissionsForObjectParameters(org.ovirt.engine.core.common.queries.GetPermissionsForObjectParameters) ArrayList(java.util.ArrayList) Frontend(org.ovirt.engine.ui.frontend.Frontend) Provider(com.google.inject.Provider) ConstantsManager(org.ovirt.engine.ui.uicompat.ConstantsManager) Permission(org.ovirt.engine.core.common.businessentities.Permission) ApplicationGuids(org.ovirt.engine.ui.uicommonweb.auth.ApplicationGuids) QueryReturnValue(org.ovirt.engine.core.common.queries.QueryReturnValue) ArrayList(java.util.ArrayList) Permission(org.ovirt.engine.core.common.businessentities.Permission) GetPermissionsForObjectParameters(org.ovirt.engine.core.common.queries.GetPermissionsForObjectParameters)

Aggregations

GetPermissionsForObjectParameters (org.ovirt.engine.core.common.queries.GetPermissionsForObjectParameters)2 Inject (com.google.inject.Inject)1 Provider (com.google.inject.Provider)1 ArrayList (java.util.ArrayList)1 VdcObjectType (org.ovirt.engine.core.common.VdcObjectType)1 Permission (org.ovirt.engine.core.common.businessentities.Permission)1 Quota (org.ovirt.engine.core.common.businessentities.Quota)1 QueryReturnValue (org.ovirt.engine.core.common.queries.QueryReturnValue)1 QueryType (org.ovirt.engine.core.common.queries.QueryType)1 Frontend (org.ovirt.engine.ui.frontend.Frontend)1 ApplicationGuids (org.ovirt.engine.ui.uicommonweb.auth.ApplicationGuids)1 HelpTag (org.ovirt.engine.ui.uicommonweb.help.HelpTag)1 PermissionListModel (org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel)1 AdElementListModel (org.ovirt.engine.ui.uicommonweb.models.users.AdElementListModel)1 ConstantsManager (org.ovirt.engine.ui.uicompat.ConstantsManager)1