projectal.entities.permission

View Source
from projectal.entity import Entity
from projectal.linkers import *
from projectal import api

class Permission(Entity, UserLinker, AccessPolicyLinker):
    """
    Implementation of the [Permission](https://projectal.com/docs/latest/#tag/Permission) API.
    """
    _path = 'permission'
    _name = 'permission'
    _links_reverse = [UserLinker, AccessPolicyLinker]


    @classmethod
    def list(cls):
        url = '/api/permission/list?start=0&limit=-1'
        response = api.get(url)
        perms = {}
        for perm in response:
            perms[perm['name']] = Permission(perm)
        return perms
View Source
class Permission(Entity, UserLinker, AccessPolicyLinker):
    """
    Implementation of the [Permission](https://projectal.com/docs/latest/#tag/Permission) API.
    """
    _path = 'permission'
    _name = 'permission'
    _links_reverse = [UserLinker, AccessPolicyLinker]


    @classmethod
    def list(cls):
        url = '/api/permission/list?start=0&limit=-1'
        response = api.get(url)
        perms = {}
        for perm in response:
            perms[perm['name']] = Permission(perm)
        return perms

Implementation of the Permission API.

#  
@classmethod
def list(cls):
View Source
    @classmethod
    def list(cls):
        url = '/api/permission/list?start=0&limit=-1'
        response = api.get(url)
        perms = {}
        for perm in response:
            perms[perm['name']] = Permission(perm)
        return perms

Return a list of all entity UUIDs of this type.

You may pass in expand=True to get full Entity objects instead, but be aware this may be very slow if you have thousands of objects.

If you are expanding the objects, you may further expand the results with links.