コード例 #1
0
def collaboratorSpecification() -> CollaboratorSpecification:
    b = CollaboratorSpecification()
    b.collaborator_types = [
        NC_('collaborator type', 'Collaborator'),
        NC_('collaborator type', 'Administrator')
    ]
    return b
コード例 #2
0
ファイル: actions.py プロジェクト: vivienney/Ally-Py
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
ファイル: populate.py プロジェクト: aaron-goshine/SDLive-Blog
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
ファイル: populate.py プロジェクト: aaron-goshine/SDLive-Blog
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
ファイル: populate.py プロジェクト: aaron-goshine/SDLive-Blog
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
ファイル: actions.py プロジェクト: poderomedia/Superdesk
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
ファイル: actions.py プロジェクト: patriciagarcia/Live-Blog
def rightMediaArchiveUpload() -> RightAction:
    return gui.actionRight(
        NC_('security', 'IAM upload'),
        NC_('security', '''
    Allows upload access to IAM.'''))
コード例 #14
0
ファイル: actions.py プロジェクト: patriciagarcia/Live-Blog
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
ファイル: actions.py プロジェクト: patriciagarcia/Live-Blog
def rightUserUpdate() -> RightAction:
    return gui.actionRight(NC_('security', 'Users update'), NC_('security', '''
    Allows the update of users.'''))
コード例 #19
0
ファイル: actions.py プロジェクト: patriciagarcia/Live-Blog
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
ファイル: actions.py プロジェクト: vivienney/Ally-Py
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
ファイル: actions.py プロジェクト: patriciagarcia/Live-Blog
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
ファイル: actions.py プロジェクト: rismalrv/Superdesk
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
ファイル: actions.py プロジェクト: rismalrv/Superdesk
def rightArticleView() -> RightAction:
    return gui.actionRight(
        NC_('security', 'Article view'),
        NC_('security', '''
    Allows read only access to Article.'''))
コード例 #28
0
ファイル: actions.py プロジェクト: patriciagarcia/Live-Blog
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'))