@Override protected boolean isPermitted() { if (target == null) { return false; } Entity singleSelected = target.getSingleSelected(); if (singleSelected == null) { return false; } if (constraintOperationType != null) { boolean isPermitted; if (constraintCode != null) { isPermitted = security.isPermitted(singleSelected, constraintCode); } else { isPermitted = security.isPermitted(singleSelected, constraintOperationType); } if (!isPermitted) { return false; } } return super.isPermitted(); }
@Override protected boolean isPermitted() { if (target == null) { return false; } Entity singleSelected = target.getSingleSelected(); if (singleSelected == null) { return false; } if (constraintOperationType != null) { boolean isPermitted; if (constraintCode != null) { isPermitted = security.isPermitted(singleSelected, constraintCode); } else { isPermitted = security.isPermitted(singleSelected, constraintOperationType); } if (!isPermitted) { return false; } } return super.isPermitted(); }
@Override protected boolean isPermitted() { if (target == null || !(target.getItems() instanceof EntityDataUnit)) { return false; } MetaClass metaClass = ((EntityDataUnit) target.getItems()).getEntityMetaClass(); if (metaClass == null) { return true; } boolean createPermitted = security.isEntityOpPermitted(metaClass, EntityOp.CREATE); if (!createPermitted) { return false; } return super.isPermitted(); }
@Override protected boolean isPermitted() { if (target == null || target.getDatasource() == null) { return false; } CollectionDatasource ownerDs = target.getDatasource(); if (ownerDs instanceof PropertyDatasource) { PropertyDatasource datasource = (PropertyDatasource) ownerDs; MetaClass parentMetaClass = datasource.getMaster().getMetaClass(); MetaProperty metaProperty = datasource.getProperty(); boolean attrPermitted = security.isEntityAttrPermitted(parentMetaClass, metaProperty.getName(), EntityAttrAccess.MODIFY); if (!attrPermitted) { return false; } } return super.isPermitted(); }
/** * Check permissions for Action */ @Override protected boolean isPermitted() { if (target == null || target.getDatasource() == null) { return false; } CollectionDatasource ownerDatasource = target.getDatasource(); MetaClass metaClass = ownerDatasource.getMetaClass(); boolean createPermitted = security.isEntityOpPermitted(metaClass, EntityOp.CREATE); if (!createPermitted) { return false; } if (ownerDatasource instanceof PropertyDatasource) { PropertyDatasource propertyDatasource = (PropertyDatasource) ownerDatasource; MetaClass parentMetaClass = propertyDatasource.getMaster().getMetaClass(); MetaProperty metaProperty = propertyDatasource.getProperty(); boolean attrPermitted = security.isEntityAttrPermitted(parentMetaClass, metaProperty.getName(), EntityAttrAccess.MODIFY); if (!attrPermitted) { return false; } } return super.isPermitted(); }
@Override protected boolean isPermitted() { if (target == null || !(target.getItems() instanceof ContainerDataUnit)) { return false; } ContainerDataUnit containerDataUnit = (ContainerDataUnit) target.getItems(); MetaClass metaClass = containerDataUnit.getEntityMetaClass(); if (metaClass == null) { return false; } if (containerDataUnit.getContainer() instanceof Nested) { Nested nestedContainer = (Nested) containerDataUnit.getContainer(); MetaClass masterMetaClass = nestedContainer.getMaster().getEntityMetaClass(); MetaProperty metaProperty = masterMetaClass.getPropertyNN(nestedContainer.getProperty()); boolean attrPermitted = security.isEntityAttrUpdatePermitted(masterMetaClass, metaProperty.getName()); if (!attrPermitted) { return false; } } return super.isPermitted(); }