Class StoreAccessService
java.lang.Object
org.bgerp.plugin.inventoru.service.StoreAccessService
Which warehouses a user may see and change.
The rule lives here rather than in an action because it is also needed outside of one — the
parameter values of a warehouse are written by the kernel action
/user/parameter,
which knows nothing about warehouses, and the plugin has to enforce access from an event
listener instead.-
Method Summary
Modifier and TypeMethodDescriptionaccessibleStoreIds(Connection con, DynActionForm form) static booleanhasAccess(Connection con, DynActionForm form, int storeId) ownStoreIds(Connection con, DynActionForm form) The warehouses of the user personally, ignoring the admin-tier permission — an admin's "my warehouse" screen has to stay their own, not every warehouse in the system.
-
Method Details
-
accessibleStoreIds
- Returns:
nullfor an admin-tier user, meaning every warehouse; otherwise the IDs of the warehouses the user owns, has an activeStoreAccessDAOgrant for, or may edit through theedit_group_idgroup — possibly an empty set.- Throws:
Exception
-
ownStoreIds
The warehouses of the user personally, ignoring the admin-tier permission — an admin's "my warehouse" screen has to stay their own, not every warehouse in the system.- Returns:
- the IDs, possibly empty.
- Throws:
Exception
-
hasAccess
- Returns:
- whether the user may change the given warehouse.
- Throws:
Exception
-