(self)
return json.dumps(has_permissions)
Return a string with the permissions of the current user.
Return a string with the permissions of the current user.
Return a string with the permissions of the current user .
def my_permissions(self):
        """Return a string with the permissions of the current user."""
        has_permissions = []

        permissions = ['read', 'write', 'delete']
        for permission in permissions:
            if self.has_permission(user=current_user, permission=permission):
                has_permissions.append(permission)

        if current_user.admin:
            has_permissions.append('admin')

        return json.dumps(has_permissions)
def my_permissions ( self ) : has_permissions = [ ] permissions = [ 'read' , 'write' , 'delete' ] for permission in permissions : if self . has_permission ( user = current_user , permission = permission ) : has_permissions . append ( permission ) if current_user . admin : has_permissions . append ( 'admin' ) return json . dumps ( has_permissions )