• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python superdesk.privilege函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: init_app

def init_app(app):
    endpoint_name = 'activity_reports'
    service = ActivityReportService(endpoint_name, backend=superdesk.get_backend())
    ActivityReportResource(endpoint_name, app=app, service=service)

    endpoint_name = 'saved_activity_reports'
    service = SavedActivityReportService(endpoint_name, backend=superdesk.get_backend())
    SavedActivityReportResource(endpoint_name, app=app, service=service)

    endpoint_name = 'track_activity_report'
    service = TrackActivityService(endpoint_name, backend=superdesk.get_backend())
    TrackActivityResource(endpoint_name, app=app, service=service)

    endpoint_name = 'processed_items_report'
    service = ProcessedItemsService(endpoint_name, backend=superdesk.get_backend())
    ProcessedItemsResource(endpoint_name, app=app, service=service)

    superdesk.privilege(name='activity_reports', label='Activity Report View',
                        description='User can view activity reports.')
    superdesk.privilege(name='track_activity_report', label='Track Activity Report View')
    superdesk.privilege(name='processed_items_report', label='Processed Items Report View',
                        description='User can view activity reports.')
开发者ID:Anca21,项目名称:superdesk-analytics,代码行数:22,代码来源:__init__.py


示例17: push_notification

        old_task = original.get('task', {})
        if new_task.get('stage') != old_task.get('stage'):
            push_notification('task:stage',
                              new_stage=str(new_task.get('stage', '')),
                              old_stage=str(old_task.get('stage', '')),
                              new_desk=str(new_task.get('desk', '')),
                              old_desk=str(old_task.get('desk', ''))
                              )
        else:
            push_notification(self.datasource, updated=1)

        if is_assigned_to_a_desk(updated):
            if self.__is_content_assigned_to_new_desk(original, updates) and \
                    not self._stage_changed(updates, original):
                insert_into_versions(doc=updated)
            add_activity(ACTIVITY_UPDATE, 'updated task {{ subject }} for item {{ type }}',
                         self.datasource, item=updated, subject=get_subject(updated), type=updated['type'])

    def on_deleted(self, doc):
        push_notification(self.datasource, deleted=1)

    def assign_user(self, item_id, user):
        return self.patch(item_id, {'task': user})

    def _stage_changed(self, updates, original):
        new_stage_id = str(updates.get('task', {}).get('stage', ''))
        old_stage_id = str(original.get('task', {}).get('stage', ''))
        return new_stage_id and new_stage_id != old_stage_id

superdesk.privilege(name='tasks', label='Tasks Management', description='Tasks Management')
开发者ID:actionless,项目名称:superdesk,代码行数:30,代码来源:tasks.py


示例18: privilege

from eve.methods.common import serialize_value

from superdesk import privilege
from superdesk.notification import push_notification
from superdesk.resource import Resource
from superdesk.services import BaseService
from superdesk.users import get_user_from_request
from superdesk.utc import utcnow
from superdesk.errors import SuperdeskApiError
from superdesk.default_schema import DEFAULT_SCHEMA, DEFAULT_EDITOR
from copy import deepcopy

logger = logging.getLogger(__name__)


privilege(name="vocabularies", label="Vocabularies Management",
          description="User can manage vocabularies' contents.")


# TODO(petr): add api to specify vocabulary schema
vocab_schema = {
    'crop_sizes': {
        'width': {'type': 'integer'},
        'height': {'type': 'integer'},
    }
}


class VocabulariesResource(Resource):
    schema = {
        '_id': {
            'type': 'string',
开发者ID:jerome-poisson,项目名称:superdesk-core,代码行数:32,代码来源:vocabularies.py


示例19: init_app

}


def init_app(app):
    endpoint_name = 'desks'
    service = DesksService(endpoint_name, backend=superdesk.get_backend())
    DesksResource(endpoint_name, app=app, service=service)
    endpoint_name = 'user_desks'
    service = UserDesksService(endpoint_name, backend=superdesk.get_backend())
    UserDesksResource(endpoint_name, app=app, service=service)
    endpoint_name = 'sluglines'
    service = SluglineDeskService(endpoint_name, backend=superdesk.get_backend())
    SluglineDesksResource(endpoint_name, app=app, service=service)


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


class DesksResource(Resource):
    schema = desks_schema
    privileges = {'POST': 'desks', 'PATCH': 'desks', 'DELETE': 'desks'}


class DesksService(BaseService):
    notification_key = 'desk'

    def create(self, docs, **kwargs):
        """
        Overriding to check if the desk being created has Working and Incoming Stages. If not then Working and Incoming
        Stages would be created and associates them with the desk and desk with the Working and Incoming Stages.
        Also sets desk_type.
开发者ID:actionless,项目名称:superdesk,代码行数:31,代码来源:desks.py


示例20: qname

    def qname(self, tag, ns=None):
        if ns is None:
            ns = self.root.tag.rsplit('}')[0].lstrip('{')
        elif ns is not None and ns == 'xml':
            ns = 'http://www.w3.org/XML/1998/namespace'

        return str(etree.QName(ns, tag))


def get_xml_parser(etree):
    """Get parser for given xml.

    :param etree: parsed xml
    """
    for parser in parsers:
        if parser.can_parse(etree):
            return parser


# must be imported for registration
import superdesk.io.nitf
import superdesk.io.newsml_2_0
import superdesk.io.newsml_1_2
import superdesk.io.wenn_parser
import superdesk.io.teletype
import superdesk.io.email
import superdesk.io.dpa
register_provider('search', None, [])

superdesk.privilege(name='ingest_providers', label='Ingest Channels', description='User can maintain Ingest Channels.')
开发者ID:ahilles107,项目名称:superdesk-1,代码行数:30,代码来源:__init__.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python superdesk.workflow_action函数代码示例发布时间:2022-05-27
下一篇:
Python superdesk.get_resource_service函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap