Exemplo n.º 1
0
    def choice(self):
        right_list = []
        for key in Dec.rightsMethods.keys():
            right_list += Dec.rightsMethods[key]

        uniq_right_list = uniq(right_list)
        uniq_right_list.sort()
        return uniq_right_list
Exemplo n.º 2
0
    def get(self):
        group_name = self.Get('cl_group_name')
        group_rights = self.Get('cl_core_group_rights')

        t = open(group_rights, 'r').read()
        results = []
        for line in t.splitlines():
            words = line.split(' ',1)
            if words[0] == group_name:
                methods = words[1].split(',')
                for i in methods:
                    results.append(i.strip())

        if group_name == 'all' and results == []:
            right_list = []
            for key in Dec.rightsMethods.keys():
                right_list += Dec.rightsMethods[key]

            uniq_right_list = uniq(right_list)
            uniq_right_list.sort()
            return uniq_right_list

        return results