示例#1
0
def init_app(app, **kwargs):
    current_api.add_oauth_scope('comments:read',
                                "Provide access to comment details")
    current_api.add_oauth_scope('comments:write',
                                "Provide write access to comment details")

    from . import models, resources

    current_api.add_namespace(resources.api)
示例#2
0
def init_app(app, **kwargs):
    """
    Init users module.
    """
    current_api.add_oauth_scope('users:read', "Provide access to user details")
    current_api.add_oauth_scope('users:write',
                                "Provide write access to user details")

    # Touch underlying modules
    from . import models, resources

    current_api.add_namespace(resources.api)
示例#3
0
def init_app(app, **kwargs):
    """
    Init auth module.
    """
    # Bind Flask-Login for current_user
    login_manager.request_loader(load_user_from_request)

    # Register OAuth scopes
    current_api.add_oauth_scope('auth:read', "Provide access to auth details")
    current_api.add_oauth_scope('auth:write',
                                "Provide write access to auth details")

    # Touch underlying modules
    from . import models, views, resources

    # Mount authentication routes
    app.register_blueprint(views.auth_blueprint)
    current_api.add_namespace(resources.api)
示例#4
0
def init_app(app, **kwargs):
    """
    Init users module.
    """
    current_api.add_oauth_scope('datasets:read',
                                "Provide access to dataset details")
    current_api.add_oauth_scope('datasets:write',
                                "Provide write access to dataset details")

    # Touch underlying modules
    from .resources import dataset, license, organization, publisher, reference, source

    current_api.add_namespace(dataset.api)
    current_api.add_namespace(license.api)
    current_api.add_namespace(organization.api)
    current_api.add_namespace(publisher.api)
    current_api.add_namespace(reference.api)
    current_api.add_namespace(source.api)