Beispiel #1
0
    def create_permissions(self):
        # module.(access|create|change|delete)_[name]
        # module.(none|read|write|admin)
        perms = [
         ('repository.none', 'Repository no access'),
         ('repository.read', 'Repository read access'),
         ('repository.write', 'Repository write access'),
         ('repository.admin', 'Repository admin access'),

         ('group.none', 'Repositories Group no access'),
         ('group.read', 'Repositories Group read access'),
         ('group.write', 'Repositories Group write access'),
         ('group.admin', 'Repositories Group admin access'),

         ('hg.admin', 'Hg Administrator'),
         ('hg.create.repository', 'Repository create'),
         ('hg.create.none', 'Repository creation disabled'),
         ('hg.register.none', 'Register disabled'),
         ('hg.register.manual_activate', 'Register new user with RhodeCode '
                                         'without manual activation'),

         ('hg.register.auto_activate', 'Register new user with RhodeCode '
                                        'without auto activation'),
        ]

        for p in perms:
            if not Permission.get_by_key(p[0]):
                new_perm = Permission()
                new_perm.permission_name = p[0]
                new_perm.permission_longname = p[1]
                self.sa.add(new_perm)
Beispiel #2
0
    def create_permissions(self):
        #module.(access|create|change|delete)_[name]
        #module.(read|write|owner)
        perms = [('repository.none', 'Repository no access'),
                 ('repository.read', 'Repository read access'),
                 ('repository.write', 'Repository write access'),
                 ('repository.admin', 'Repository admin access'),
                 ('hg.admin', 'Hg Administrator'),
                 ('hg.create.repository', 'Repository create'),
                 ('hg.create.none', 'Repository creation disabled'),
                 ('hg.register.none', 'Register disabled'),
                 ('hg.register.manual_activate', 'Register new user with '
                                                 'RhodeCode without manual'
                                                 'activation'),

                 ('hg.register.auto_activate', 'Register new user with '
                                               'RhodeCode without auto '
                                               'activation'),
                ]

        for p in perms:
            new_perm = Permission()
            new_perm.permission_name = p[0]
            new_perm.permission_longname = p[1]
            try:
                self.sa.add(new_perm)
                self.sa.commit()
            except:
                self.sa.rollback()
                raise
Beispiel #3
0
    def create_permissions(self):
        # module.(access|create|change|delete)_[name]
        # module.(none|read|write|admin)
        perms = [
            ('repository.none', 'Repository no access'),
            ('repository.read', 'Repository read access'),
            ('repository.write', 'Repository write access'),
            ('repository.admin', 'Repository admin access'),
            ('group.none', 'Repositories Group no access'),
            ('group.read', 'Repositories Group read access'),
            ('group.write', 'Repositories Group write access'),
            ('group.admin', 'Repositories Group admin access'),
            ('hg.admin', 'Hg Administrator'),
            ('hg.create.repository', 'Repository create'),
            ('hg.create.none', 'Repository creation disabled'),
            ('hg.register.none', 'Register disabled'),
            ('hg.register.manual_activate', 'Register new user with RhodeCode '
             'without manual activation'),
            ('hg.register.auto_activate', 'Register new user with RhodeCode '
             'without auto activation'),
        ]

        for p in perms:
            if not Permission.get_by_key(p[0]):
                new_perm = Permission()
                new_perm.permission_name = p[0]
                new_perm.permission_longname = p[1]
                self.sa.add(new_perm)
Beispiel #4
0
    def create_permissions(self):
        # module.(access|create|change|delete)_[name]
        # module.(none|read|write|admin)

        for p in Permission.PERMS:
            if not Permission.get_by_key(p[0]):
                new_perm = Permission()
                new_perm.permission_name = p[0]
                new_perm.permission_longname = p[0]
                self.sa.add(new_perm)
Beispiel #5
0
    def create_permissions(self):
        # module.(access|create|change|delete)_[name]
        # module.(none|read|write|admin)

        for p in Permission.PERMS:
            if not Permission.get_by_key(p[0]):
                new_perm = Permission()
                new_perm.permission_name = p[0]
                new_perm.permission_longname = p[0]
                self.sa.add(new_perm)
Beispiel #6
0
 def create_permissions(self):
     """
     Create permissions for whole system
     """
     for p in Permission.PERMS:
         if not Permission.get_by_key(p[0]):
             new_perm = Permission()
             new_perm.permission_name = p[0]
             new_perm.permission_longname = p[0]  #translation err with p[1]
             self.sa.add(new_perm)
Beispiel #7
0
 def create_permissions(self):
     """
     Create permissions for whole system
     """
     for p in Permission.PERMS:
         if not Permission.get_by_key(p[0]):
             new_perm = Permission()
             new_perm.permission_name = p[0]
             new_perm.permission_longname = p[0]  #translation err with p[1]
             self.sa.add(new_perm)