permissions/index
@boldpenguin/sdk-redux › Globals › "permissions/index"
Index
Variables
Variables
Const
doesUserOwnApplicationForm
• doesUserOwnApplicationForm: function & OutputSelectorFields‹function› & object = createSelector( [getUserId, getApplicationForm], (userId, appForm) => !!(appForm != null && userId === appForm.owner_id) )
Indicates if current authenticated user owns the current application form
param
The BpSdk Redux store
Const
getAllUsersPermissions
• getAllUsersPermissions: function & OutputSelectorFields‹function› & object = createSelector(getAuth, (auth) => auth.permissions)
Returns all permissions for the current user
param
The BpSdk Redux store
Const
userHasPermission
• userHasPermission: function & OutputSelectorFields‹function› & object = createSelector( [ selectUser, (_: BpSdkStore, params: { permission: BpSdkPermissions; action?: BpSdkPermissionAction; object?: Record<string, unknown> }) => ({ ...params, }), ], (user, { permission, object, action }) => { const obj = getPermissionsObject(permission); return hasPermission({ user, object, action: action ?? obj.action, model: obj.model || permission }); } )
Indicates whether user has the requested permission
param
The entire Redux store
param
BpSdkPermissions object
param
Optional object to run permissions against