Skip to main content

Checking User Access

Once users have been granted permissions either directly or indirectly through usersets or rules, you can access is various ways.

Checking access for a resource object#

granted = v.users.check('user_id', 'action', 'object_id', 'resource_type')
# granted = [{#     action: 'action',#     resource_id: 'resource_object_id',#     resource_type: 'resource_type'# }]

List all permissions for user#

# permissions = v.users.expand('user_id')
# permissions = [{#     action: 'action',#     resource_id: 'resource_object_id',#     resource_type: 'resource_type'# }, {#     action: 'action2',#     resource_id: 'resource_object_id',#     resource_type: 'resource_type'# }, ...]