...
Code Block |
---|
@pkgV1Objectdata('view') AND @pkgV1Objectdata('update') |
Adapting PreparedWhere
As of
Status | ||
---|---|---|
|
AbstractPreparedWhereBusinessService
to resolve bases according to users’ given permissions:2 contexts are available:
base_pkgsecurity_view
will return aPreparedWhere
following user’s given VIEW permissionsbase_pkgsecurity_update
will return aPreparedWhere
following user’s given UPDATE permissions
You can easily make use of those context to augment base_list
, base_edit_list
, base_search
… in your project accordingly:
Code Block | ||
---|---|---|
| ||
import com.noheto.extensions.interfaces.services.AbstractPreparedWhereBusinessService;
import com.noheto.preparedwhere.PreparedWhereService;
import wsnoheto.engine.*;
public class ProjectExtendedBaseList extends AbstractPreparedWhereBusinessService {
@Override
public PreparedWhere getPreparedWhere(String contextName, CTSurfer surfer, String objectName, IObjectStructureReadOnly struct, IObjectTableReadOnly table) throws PreparedWhereException {
PreparedWhere pwProjectConstraints = PreparedWhere.load("");
// ... your project specific constraint
// retrieve a PreparedWhere compliant with surfer's permission
// note that if user has no permission, you will get 0=1 constraint
PreparedWhere pwPackagedSecurity = PreparedWhereService.getInstance()
.getPreparedWhere("base_pkgsecurity_view", surfer, objectName);
return pwProjectConstraints.and(pwPackagedSecurity);
}
} |
Extending capabilities
Meta statuses definitions
...