Example #1
0
def init_app(app):
    endpoint_name = 'auth'
    service = BaseService('auth', backend=superdesk.get_backend())
    AuthResource(endpoint_name, app=app, service=service)

    service = BaseService('auth_user', backend=superdesk.get_backend())
    AuthUsersResource('auth_user', app=app, service=service)
Example #2
0
def init_app(app):
    endpoint_name = 'auth'
    service = ADAuthService(endpoint_name, backend=superdesk.get_backend())
    AuthResource(endpoint_name, app=app, service=service)

    endpoint_name = ImportUserProfileResource.url
    service = ImportUserProfileService(endpoint_name, backend=superdesk.get_backend())
    ImportUserProfileResource(endpoint_name, app=app, service=service)
Example #3
0
def init_app(app):
    endpoint_name = 'auth_db'
    service = AccessAuthService('auth', backend=superdesk.get_backend())
    AuthResource(endpoint_name, app=app, service=service)

    endpoint_name = 'reset_user_password'
    service = ResetPasswordService(endpoint_name, backend=superdesk.get_backend())
    ResetPasswordResource(endpoint_name, app=app, service=service)

    endpoint_name = 'change_user_password'
    service = ChangePasswordService(endpoint_name, backend=superdesk.get_backend())
    ChangePasswordResource(endpoint_name, app=app, service=service)

    endpoint_name = 'active_tokens'
    service = superdesk.Service(endpoint_name, backend=superdesk.get_backend())
    ActiveTokensResource(endpoint_name, app=app, service=service)
Example #4
0
def init_app(app):
    endpoint_name = "auth_db"
    service = DbAuthService("auth", backend=superdesk.get_backend())
    AuthResource(endpoint_name, app=app, service=service)

    endpoint_name = "reset_user_password"
    service = ResetPasswordService(endpoint_name,
                                   backend=superdesk.get_backend())
    ResetPasswordResource(endpoint_name, app=app, service=service)

    endpoint_name = "change_user_password"
    service = ChangePasswordService(endpoint_name,
                                    backend=superdesk.get_backend())
    ChangePasswordResource(endpoint_name, app=app, service=service)

    endpoint_name = "active_tokens"
    service = BaseService(endpoint_name, backend=superdesk.get_backend())
    ActiveTokensResource(endpoint_name, app=app, service=service)
Example #5
0
def init_app(app):
    endpoint_name = "users"
    service = ADUsersService(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"])

    # we need to use the same endpoint as database auth because it is called in the same location
    endpoint_name = "auth_db"
    service = ADAuthService(endpoint_name, backend=superdesk.get_backend())
    AuthResource(endpoint_name, app=app, service=service)

    endpoint_name = ImportUserProfileResource.url
    service = ImportUserProfileService(endpoint_name, backend=superdesk.get_backend())
    ImportUserProfileResource(endpoint_name, app=app, service=service)
Example #6
0
def init_app(app):
    endpoint_name = 'users'
    service = ADUsersService(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'])

    endpoint_name = 'auth'
    service = ADAuthService(endpoint_name, backend=superdesk.get_backend())
    AuthResource(endpoint_name, app=app, service=service)

    endpoint_name = ImportUserProfileResource.url
    service = ImportUserProfileService(endpoint_name,
                                       backend=superdesk.get_backend())
    ImportUserProfileResource(endpoint_name, app=app, service=service)