当前位置: 首页>>代码示例>>Python>>正文


Python superdesk.privilege函数代码示例

本文整理汇总了Python中superdesk.privilege函数的典型用法代码示例。如果您正苦于以下问题:Python privilege函数的具体用法?Python privilege怎么用?Python privilege使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了privilege函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: init_app

def init_app(app):
    endpoint_name = 'products'
    service = ProductsService(endpoint_name, backend=get_backend())
    ProductsResource(endpoint_name, app=app, service=service)

    superdesk.privilege(name='products', label='Products Management',
                        description='User can manage product lists.')
开发者ID:MiczFlor,项目名称:superdesk-core,代码行数:7,代码来源:__init__.py

示例2: init_app

def init_app(app):

    endpoint_name = 'archive_publish'
    service = ArchivePublishService(endpoint_name, backend=get_backend())
    ArchivePublishResource(endpoint_name, app=app, service=service)

    endpoint_name = 'archive_kill'
    service = KillPublishService(endpoint_name, backend=get_backend())
    KillPublishResource(endpoint_name, app=app, service=service)

    endpoint_name = 'archive_correct'
    service = CorrectPublishService(endpoint_name, backend=get_backend())
    CorrectPublishResource(endpoint_name, app=app, service=service)

    endpoint_name = 'subscribers'
    service = SubscribersService(endpoint_name, backend=get_backend())
    SubscribersResource(endpoint_name, app=app, service=service)

    endpoint_name = 'publish_queue'
    service = PublishQueueService(endpoint_name, backend=get_backend())
    PublishQueueResource(endpoint_name, app=app, service=service)

    endpoint_name = 'published'
    service = PublishedItemService(endpoint_name, backend=get_backend())
    PublishedItemResource(endpoint_name, app=app, service=service)

    superdesk.privilege(name='subscribers', label='Subscribers', description='User can manage subscribers')
    superdesk.privilege(name='publish', label='Publish', description='Publish a content')
    superdesk.privilege(name='kill', label='Kill', description='Kill a published content')
    superdesk.privilege(name='correct', label='Correction', description='Correction to a published content')
    superdesk.privilege(name='publish_queue', label='Publish Queue', description='User can update publish queue')
开发者ID:oxcarh,项目名称:superdesk,代码行数:31,代码来源:__init__.py

示例3: init_app

def init_app(app):
    from apps.search_providers.proxy import SearchProviderProxyResource, SearchProviderProxyService
    superdesk.privilege(
        name='search_providers',
        label='Manage Search Providers',
        description='User can manage search providers.'
    )

    superdesk.register_resource(
        name='search_providers',
        resource=SearchProviderResource,
        service=SearchProviderService
    )

    superdesk.register_resource(
        name='search_providers_proxy',
        resource=SearchProviderProxyResource,
        service=SearchProviderProxyService
    )

    superdesk.register_resource(
        name='search_providers_allowed',
        resource=SearchProviderAllowedResource,
        service=SearchProviderAllowedService
    )
开发者ID:jerome-poisson,项目名称:superdesk-core,代码行数:25,代码来源:__init__.py

示例4: init_app

def init_app(app):

    endpoint_name = 'archive_publish'
    service = ArchivePublishService(endpoint_name, backend=get_backend())
    ArchivePublishResource(endpoint_name, app=app, service=service)

    superdesk.privilege(name='publish', label='Publish', description='Publish a content')
开发者ID:yukoff,项目名称:superdesk,代码行数:7,代码来源:__init__.py

示例5: init_app

def init_app(app):
    endpoint_name = 'dictionaries'
    service = DictionaryService(endpoint_name, backend=superdesk.get_backend())
    DictionariesResource(endpoint_name, app=app, service=service)

    superdesk.privilege(name='dictionaries', label='Dictionaries List Management',
                        description='User can manage dictionaries lists.')
开发者ID:MiczFlor,项目名称:superdesk-core,代码行数:7,代码来源:__init__.py

示例6: init_app

def init_app(app):

    endpoint_name = 'archive_publish'
    service = ArchivePublishService(endpoint_name, backend=get_backend())
    ArchivePublishResource(endpoint_name, app=app, service=service)

    endpoint_name = 'subscribers'
    service = SubscribersService(endpoint_name, backend=get_backend())
    SubscribersResource(endpoint_name, app=app, service=service)

    endpoint_name = 'publish_queue'
    service = PublishQueueService(endpoint_name, backend=get_backend())
    PublishQueueResource(endpoint_name, app=app, service=service)

    endpoint_name = 'formatted_item'
    service = FormattedItemService(endpoint_name, backend=get_backend())
    FormattedItemResource(endpoint_name, app=app, service=service)

    endpoint_name = 'output_channels'
    service = OutputChannelsService(endpoint_name, backend=get_backend())
    OutputChannelsResource(endpoint_name, app=app, service=service)

    endpoint_name = 'destination_groups'
    service = DestinationGroupsService(endpoint_name, backend=get_backend())
    DestinationGroupsResource(endpoint_name, app=app, service=service)

    superdesk.privilege(name='publish', label='Publish', description='Publish a content')
    superdesk.privilege(name='destination_groups', label='Destination Groups',
                        description='User can manage destination groups')
    superdesk.privilege(name='output_channels', label='Output Channels',
                        description='User can manage output channels')
    superdesk.privilege(name='subscribers', label='Subscribers',
                        description='User can manage subscribers')
    superdesk.privilege(name='publish_queue', label='Publish Queue',
                        description='User can update publish queue')
开发者ID:girgen79,项目名称:superdesk,代码行数:35,代码来源:__init__.py

示例7: init_app

def init_app(app):
    endpoint_name = 'content_types'
    service = ContentTypesService(endpoint_name, backend=superdesk.get_backend())
    ContentTypesResource(endpoint_name, app=app, service=service)
    superdesk.privilege(name=CONTENT_TYPE_PRIVILEGE,
                        label='Content Profile',
                        description='Manage content profiles')
开发者ID:hlmnrmr,项目名称:superdesk-core,代码行数:7,代码来源:__init__.py

示例8: init_app

def init_app(app):
    endpoint_name = 'users'
    service = DBUsersService(endpoint_name, backend=superdesk.get_backend())
    UsersResource(endpoint_name, app=app, service=service)

    superdesk.privilege(name='users', label='User Management', description='User can manage users.')

    # Registering with intrinsic privileges because: A user should be allowed to update their own profile.
    superdesk.intrinsic_privilege(resource_name='users', method=['PATCH'])
开发者ID:MiczFlor,项目名称:superdesk-core,代码行数:9,代码来源:__init__.py

示例9: init_app

def init_app(app):
    if app.config.get("ENABLE_PROFILING"):
        endpoint_name = "profiling"
        service = ProfilingService(endpoint_name, backend=superdesk.get_backend())
        ProfilingResource(endpoint_name, app=app, service=service)

        superdesk.privilege(name="profiling", label="Profiling Service", description="User can read profiling data.")

        profile.enable()
开发者ID:hlmnrmr,项目名称:superdesk-core,代码行数:9,代码来源:__init__.py

示例10: init_app

def init_app(app):
    register_resource(
        NAME,
        InternalDestinationsResource,
        InternalDestinationsService,
        _app=app)

    privilege(
        name=NAME,
        label='Internal Destinations',
        description='User can manage internal destinations.')

    item_published.connect(handle_item_published)
开发者ID:jerome-poisson,项目名称:superdesk-core,代码行数:13,代码来源:internal_destinations.py

示例11: init_app

def init_app(app):
    endpoint_name = 'highlights'
    service = HighlightsService(endpoint_name, backend=get_backend())
    HighlightsResource(endpoint_name, app=app, service=service)

    endpoint_name = 'marked_for_highlights'
    service = MarkedForHighlightsService(endpoint_name, backend=get_backend())
    MarkedForHighlightsResource(endpoint_name, app=app, service=service)

    superdesk.privilege(name='highlights', label='Highlights/Summary List Management',
                        description='User can manage highlights/summary lists.')
    superdesk.privilege(name='mark_for_highlights', label='Mark items for Highlights/Summary Lists',
                        description='User can mark items for Highlights/Summary Lists.')
开发者ID:akintolga,项目名称:superdesk-server,代码行数:13,代码来源:__init__.py

示例12: init_app

def init_app(app):
    endpoint_name = LEGAL_ARCHIVE_NAME
    service = LegalArchiveService(endpoint_name, backend=get_backend())
    LegalArchiveResource(endpoint_name, app=app, service=service)

    endpoint_name = LEGAL_ARCHIVE_VERSIONS_NAME
    service = LegalArchiveVersionsService(endpoint_name, backend=get_backend())
    LegalArchiveVersionsResource(endpoint_name, app=app, service=service)

    endpoint_name = LEGAL_PUBLISH_QUEUE_NAME
    service = LegalPublishQueueService(endpoint_name, backend=get_backend())
    LegalPublishQueueResource(endpoint_name, app=app, service=service)

    privilege(name=LEGAL_ARCHIVE_NAME, label='Legal Archive', description='Read from legal archive')
开发者ID:ancafarcas,项目名称:superdesk,代码行数:14,代码来源:__init__.py

示例13: init_app

def init_app(app):
    endpoint_name = 'filter_conditions'
    service = FilterConditionService(endpoint_name, backend=get_backend())
    FilterConditionResource(endpoint_name, app=app, service=service)

    endpoint_name = 'filter_condition_parameters'
    service = FilterConditionParametersService(endpoint_name, backend=get_backend())
    FilterConditionParametersResource(endpoint_name, app=app, service=service)

    endpoint_name = 'publish_filters'
    service = PublishFilterService(endpoint_name, backend=get_backend())
    PublishFilterResource(endpoint_name, app=app, service=service)

    endpoint_name = 'publish_filter_tests'
    service = PublishFilterTestService(endpoint_name, backend=superdesk.get_backend())
    PublishFilterTestResource(endpoint_name, app=app, service=service)

    superdesk.privilege(name='publish_filters', label='Publish Filters',
                        description='User can manage publish filters')
开发者ID:oxcarh,项目名称:superdesk,代码行数:19,代码来源:__init__.py

示例14: init_app

def init_app(app):
    endpoint_name = 'mission_report'
    service = MissionReportService(endpoint_name, backend=superdesk.get_backend())
    MissionReportResource(endpoint_name, app=app, service=service)
    register_report('mission_report', 'mission_report')

    superdesk.privilege(
        name='mission_report',
        label='Mission Report View',
        description='User can view mission reports.'
    )

    endpoint_name = 'sms_report'
    service = SMSReportService(endpoint_name, backend=superdesk.get_backend())
    SMSReportResource(endpoint_name, app=app, service=service)
    register_report('sms_report', 'sms_report')

    superdesk.privilege(
        name='sms_report',
        label='SMS Report View',
        description='User can view sms reports.'
    )
开发者ID:mdhaman,项目名称:superdesk-aap,代码行数:22,代码来源:__init__.py

示例15: init_app

def init_app(app):
    endpoint_name = 'ingest_providers'
    service = IngestProviderService(endpoint_name, backend=superdesk.get_backend())
    IngestProviderResource(endpoint_name, app=app, service=service)

    from .io_errors import IOErrorsService, IOErrorsResource
    endpoint_name = 'io_errors'
    service = IOErrorsService(endpoint_name, backend=superdesk.get_backend())
    IOErrorsResource(endpoint_name, app=app, service=service)

    endpoint_name = 'ingest'
    service = IngestService(endpoint_name, backend=superdesk.get_backend())
    IngestResource(endpoint_name, app=app, service=service)

    superdesk.register_resource(
        name='feed_parsers_allowed',
        resource=FeedParserAllowedResource,
        service=FeedParserAllowedService
    )
    superdesk.privilege(
        name='feed_parsers',
        label='Ingest Feed Parsers',
        description='User can maintain Ingest Feed Parsers.'
    )

    superdesk.register_resource(
        name='feeding_services_allowed',
        resource=FeedingServiceAllowedResource,
        service=FeedingServiceAllowedService
    )

    superdesk.privilege(
        name='feeding_services',
        label='Ingest Feed Services',
        description='User can maintain Ingest Feed Services.'
    )
开发者ID:superdesk,项目名称:superdesk-core,代码行数:36,代码来源:__init__.py


注:本文中的superdesk.privilege函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。