def get_roles_with_access_content(obj, request=None): """ Return the roles that has access to the content that are global roles""" if obj is None: return [] if request is None: request = get_current_request() interaction = IInteraction(request) roles = interaction.cached_roles(obj, 'guillotina.AccessContent', 'o') result = [] all_roles = role.global_roles() + role.local_roles() for r in roles.keys(): if r in all_roles: result.append(r) return result
def get_roles_with_access_content(obj, request=None): """ Return the roles that has access to the content that are global roles""" if obj is None: return [] if request is None: request = get_current_request() interaction = IInteraction(request) roles = interaction.cached_roles(obj, 'guillotina.AccessContent', 'o') result = [] all_roles = role.global_roles() + role.local_roles() for r in roles.keys(): if r in all_roles: result.append(r) return result
def get_principals_with_access_content(obj, request=None): if obj is None: return {} if request is None: request = get_current_request() interaction = IInteraction(request) roles = interaction.cached_roles(obj, 'guillotina.AccessContent', 'o') result = [] all_roles = role.global_roles() + role.local_roles() for r in roles.keys(): if r in all_roles: result.append(r) users = interaction.cached_principals(obj, result, 'guillotina.AccessContent', 'o') return list(users.keys())
def get_principals_with_access_content(obj, request=None): if obj is None: return {} if request is None: request = get_current_request() interaction = IInteraction(request) roles = interaction.cached_roles(obj, 'guillotina.AccessContent', 'o') result = [] all_roles = role.global_roles() + role.local_roles() for r in roles.keys(): if r in all_roles: result.append(r) users = interaction.cached_principals(obj, result, 'guillotina.AccessContent', 'o') return list(users.keys())