Exemplo n.º 1
0
"""
Disable multi-factor authentication (MFA) for the user.
"""

from manhattan.nav import Nav
from manhattan.users import views

from blueprints.users.manage.config import UserConfig

# Chains
disable_chains = views.mfa.disable_chains.copy()

# Set the URL
UserConfig.add_view_rule('/security/mfa/disable', 'mfa_disable',
                         disable_chains)

# Set the nav rules
Nav.apply(UserConfig.get_endpoint('mfa_disable'), ['mfa_enabled'])
Exemplo n.º 2
0
"""
Delete a user.
"""

from manhattan.nav import Nav
from manhattan.users import views

from blueprints.users.manage.config import UserConfig

# Chains
delete_chains = views.delete_chains.copy()

# Set the URL
UserConfig.add_view_rule('/users/delete', 'delete', delete_chains)

# Set the nav rules
Nav.apply(UserConfig.get_endpoint('delete'), ['not_me'])
Exemplo n.º 3
0
"""
Regenerate the user's list of recovery codes.
"""

from manhattan.nav import Nav
from manhattan.users import views

from blueprints.users.manage.config import UserConfig

# Chains
regenerate_recovery_codes_chains \
        = views.mfa.regenerate_recovery_codes_chains.copy()

# Set URL
UserConfig.add_view_rule('/security/mfa/regenerate-recovery-codes',
                         'mfa_regenerate_recovery_codes',
                         regenerate_recovery_codes_chains)

# Set nav rules
Nav.apply(UserConfig.get_endpoint('mfa_regenerate_recovery_codes'),
          ['mfa_enabled'])
Exemplo n.º 4
0
"""
Update a user.
"""

from manhattan.nav import Nav
from manhattan.users import views

from blueprints.users.manage.config import UserConfig

# Chains
update_chains = views.update_chains.copy()

# Set the URL
UserConfig.add_view_rule('/users/update', 'update', update_chains)

# Set the nav rules
Nav.apply(UserConfig.get_endpoint('update'), ['not_me'])
Exemplo n.º 5
0
"""
Primary navigation menu for the manage area.
"""

from manhattan.nav import Nav, NavItem
from mongoframes import Q

from blueprints.accounts.manage.config import AccountConfig
from blueprints.assets.manage.config import AssetConfig
from blueprints.users.manage.config import UserConfig

# Define the primary menu
menu = Nav.menu('manage')

# Dashboard
menu.add(NavItem('Dashboard', UserConfig.get_endpoint('dashboard')))

# Assets

assets_group = Nav.menu('assets_group')
assets_group.label = 'Assets'
assets_group.data = {'group': True}
menu.add(assets_group)

# Assets > Assets
assets_group.add(NavItem('Assets', AssetConfig.get_endpoint('list')))

# Admin

admin_group = Nav.menu('admin_group')
admin_group.label = 'Admin'
Exemplo n.º 6
0
"""
Download a text file containing the user's recovery codes.
"""

from manhattan.nav import Nav
from manhattan.users import views

from blueprints.users.manage.config import UserConfig

# Chains
download_recovery_codes_chains \
        = views.mfa.download_recovery_codes_chains.copy()

# Set the URL
UserConfig.add_view_rule('/security/mfa/download-recovery-codes',
                         'mfa_download_recovery_codes',
                         download_recovery_codes_chains)

# Set nav rules
Nav.apply(UserConfig.get_endpoint('mfa_download_recovery_codes'),
          ['mfa_enabled'])
Exemplo n.º 7
0
"""
View the user's recovery codes.
"""

from manhattan.nav import Nav
from manhattan.users import views

from blueprints.users.manage.config import UserConfig

# Chains
recovery_codes_chains = views.mfa.recovery_codes_chains.copy()

# Set the URL
UserConfig.add_view_rule('/security/mfa/recovery-codes', 'mfa_recovery_codes',
                         recovery_codes_chains)

# Set the nav rules
Nav.apply(UserConfig.get_endpoint('mfa_recovery_codes'), ['mfa_enabled'])
Exemplo n.º 8
0
Arquivo: auth.py Projeto: GetmeUK/h51
"""
Authorize the user using a secondary mechanism.
"""

from manhattan.nav import Nav
from manhattan.users import views

from blueprints.users.manage.config import UserConfig

# Chains
auth_chains = views.mfa.auth_chains.copy()

# Set the URL
UserConfig.add_view_rule('/security/mfa/auth', 'mfa_auth', auth_chains)

# Set nav rules
Nav.apply(UserConfig.get_endpoint('mfa_auth'), ['mfa_enabled'])