예제 #1
0
def collaboratorSpecification() -> CollaboratorSpecification:
    b = CollaboratorSpecification()
    b.collaborator_types = [
        NC_('collaborator type', 'Collaborator'),
        NC_('collaborator type', 'Administrator')
    ]
    return b
예제 #2
0
def rightRequestsInspection() -> RightAction:
    return gui.actionRight(
        NC_('security', 'Requests inspection'),
        NC_(
            'security', '''
    Allows for the viewing of all possible requests that can be made on the REST server, also the plugins and components
    that are part of the application are also visible.'''))
예제 #3
0
파일: acl.py 프로젝트: vivienney/Ally-Py
def rightTranslationManage():
    return aclRight(
        NC_('security', 'Translation manage'),
        NC_(
            'security', '''
    Allows for the modification of translatable messages that the application uses.'''
        ))
예제 #4
0
파일: acl.py 프로젝트: vivienney/Ally-Py
def rightTranslationModify():
    return aclRight(
        NC_('security', 'Translation modify'),
        NC_(
            'security', '''
    Allows for the modification of translation files by the upload of updated PO files.'''
        ))
예제 #5
0
파일: gui.py 프로젝트: vivienney/Ally-Py
 def actionType() -> TypeAcl:
     b = TypeAcl(
         NC_('security', 'GUI based access control layer'),
         NC_(
             'security',
             'Right type for the graphical user interface based access control layer right setups'
         ))
     acl.acl().add(b)
     return b
예제 #6
0
def blogRoleEditorId():
    roleService = support.entityFor(IRoleService)
    assert isinstance(roleService, IRoleService)

    roles = roleService.getAll(limit=1, q=QRole(name='Editor'))
    try: editor = next(iter(roles))
    except StopIteration:
        editor = Role()
        editor.Name = NC_('security role', 'Editor')
        editor.Description = NC_('security role', 'Role that allows editor stuff')
        return roleService.insert(editor)
    return editor.Id
예제 #7
0
def blogRoleCollaboratorId():
    roleService = support.entityFor(IRoleService)
    assert isinstance(roleService, IRoleService)

    roles = roleService.getAll(limit=1, q=QRole(name='Collaborator'))
    try: collaborator = next(iter(roles))
    except StopIteration:
        collaborator = Role()
        collaborator.Name = NC_('security role', 'Collaborator')
        collaborator.Description = NC_('security role', 'Role that allows submit to desk and edit his own posts')
        return roleService.insert(collaborator)
    return collaborator.Id
예제 #8
0
def blogRoleAdministratorId():
    roleService = support.entityFor(IRoleService)
    assert isinstance(roleService, IRoleService)

    roles = roleService.getAll(limit=1, q=QRole(name='Administrator'))
    try: admin = next(iter(roles))
    except StopIteration:
        admin = Role()
        admin.Name = NC_('security role', 'Administrator')
        admin.Description = NC_('security role', 'Role that allows all rights')
        return roleService.insert(admin)
    return admin.Id
예제 #9
0
def menuAction():
    return Action('media-archive',
                  Parent=defaults.menuAction(),
                  Label=NC_('Menu', 'Media Archive'),
                  Href='/media-archive',
                  ScriptPath=getPublishedGui(
                      'media-archive/scripts/js/menu-media-archive.js'))
예제 #10
0
def populateRootRole():
    roleService = support.entityFor(IRoleService)
    assert isinstance(roleService, IRoleService)

    roles = roleService.getAll(limit=1, q=QRole(name=NAME_ROOT))
    if not roles:
        rootRole = Role()
        rootRole.Name = NAME_ROOT
        rootRole.Description = NC_('security role', 'Default role that provides access to all available roles and rights')
        roleService.insert(rootRole)
예제 #11
0
파일: acl.py 프로젝트: vivienney/Ally-Py
def rightTranslationAccess():
    return aclRight(
        NC_('security', 'Translation access'),
        NC_('security', '''
    Allows read only access to the translation files.'''))
예제 #12
0
파일: acl.py 프로젝트: vivienney/Ally-Py
def captcha() -> RightService:
    return RightService(
        'CAPTCHA', NC_('security', 'Right that targets CAPTCHA validations'))
예제 #13
0
def rightMediaArchiveUpload() -> RightAction:
    return gui.actionRight(
        NC_('security', 'IAM upload'),
        NC_('security', '''
    Allows upload access to IAM.'''))
예제 #14
0
def rightUserView() -> RightAction:
    return gui.actionRight(NC_('security', 'Users view'), NC_('security', '''
    Allows read only access to users.'''))
예제 #15
0
파일: actions.py 프로젝트: finid/Superdesk
def rightManageOwnPost() -> RightAction:
    return gui.actionRight(
        NC_('security', 'Manage own post'),
        NC_(
            'security', '''
    Allows the creation and management of own posts in livedesk.'''))
예제 #16
0
@package: security RBAC
@copyright: 2012 Sourcefabric o.p.s.
@license: http://www.gnu.org/licenses/gpl-3.0.txt
@author: Gabriel Nistor

Contains the setups for populating default data.
'''

from ally.container import support, app, ioc
from ally.internationalization import NC_
from security.rbac.api.rbac import IRoleService, Role, QRole

# --------------------------------------------------------------------

NAME_ROOT = NC_('security role', 'ROOT')  # The name for the root role

# --------------------------------------------------------------------

@ioc.entity
def rootRoleId():
    roleService = support.entityFor(IRoleService)
    assert isinstance(roleService, IRoleService)
    return roleService.getByName(NAME_ROOT).Id

@app.populate(priority=app.PRIORITY_FIRST)
def populateRootRole():
    roleService = support.entityFor(IRoleService)
    assert isinstance(roleService, IRoleService)

    roles = roleService.getAll(limit=1, q=QRole(name=NAME_ROOT))
예제 #17
0
def menuAction():
    return Action(
        'sandbox',
        Parent=defaults.menuAction(),
        Label=NC_('Menu', 'Sandbox'),
        Script=publishedURI('superdesk/sandbox/scripts/js/menu-sandbox.js'))
예제 #18
0
def rightUserUpdate() -> RightAction:
    return gui.actionRight(NC_('security', 'Users update'), NC_('security', '''
    Allows the update of users.'''))
예제 #19
0
def rightMediaArchiveAudioView() -> RightAction:
    return gui.actionRight(NC_('security', 'IAM Audio view'), NC_('security', '''
    Allows read only access to IAM Audio items.''')) 
예제 #20
0
파일: actions.py 프로젝트: finid/Superdesk
def rightLivedeskUpdate() -> RightAction:
    return gui.actionRight(
        NC_('security', 'Livedesk edit'),
        NC_('security', '''
    Allows edit access to users for livedesk.'''))
예제 #21
0
파일: actions.py 프로젝트: finid/Superdesk
def rightLivedeskView() -> RightAction:
    return gui.actionRight(
        NC_('security', 'Livedesk view'),
        NC_('security', '''
    Allows read only access to users for livedesk.'''))
예제 #22
0
def menuAction() -> Action:
    return Action('request',
                  NC_('menu', 'Request'),
                  Parent=defaults.menuAction(),
                  NavBar='/api-requests',
                  Script=publishedURI('superdesk/request/scripts/js/menu.js'))
예제 #23
0
파일: actions.py 프로젝트: finid/Superdesk
def rightBlogEdit() -> RightAction:
    return gui.actionRight(
        NC_('security', 'Blog edit'),
        NC_('security', '''
    Allows for editing the blog.'''))
예제 #24
0
def menuAction() -> Action:
    return Action('user', Parent=defaults.menuAction(), Label=NC_('menu', 'Users'), NavBar='/users',
                  Script=publishedURI('superdesk/user/scripts/js/menu.js'))
예제 #25
0
파일: actions.py 프로젝트: finid/Superdesk
def menuAction() -> Action:
    return Action('livedesk',
                  Parent=defaults.menuAction(),
                  Label=NC_('menu', 'Live Blogs'))
예제 #26
0
def menuAction() -> Action:
    return Action('article',
                  Parent=defaults.menuAction(),
                  Label=NC_('menu', 'Article'),
                  NavBar='/article',
                  Script=publishedURI('superdesk/article/scripts/js/menu.js'))
예제 #27
0
def rightArticleView() -> RightAction:
    return gui.actionRight(
        NC_('security', 'Article view'),
        NC_('security', '''
    Allows read only access to Article.'''))
예제 #28
0
def menuAction() -> Action:
    return Action('media-archive',
                  Parent=defaults.menuAction(),
                  Label=NC_('menu', 'Media Archive'),
                  NavBar='/media-archive',
                  Script=publishedURI('media-archive/scripts/js/menu.js'))