1 from coprs import exceptions
2
3 from coprs import app, db
4 from coprs.models import User, Group
8
9 @classmethod
10 - def get(cls, username):
12
13 @classmethod
16
17 @classmethod
19 """
20 Raise InsufficientRightsException if given user cant update
21 given copr. Return None otherwise.
22 """
23
24
25
26 if not user.can_edit(copr):
27 raise exceptions.InsufficientRightsException(message)
28
29 @classmethod
31 """
32 Raises InsufficientRightsException if given user cant build in
33 given copr. Return None otherwise.
34 """
35
36 if not user.can_build_in(copr):
37 raise exceptions.InsufficientRightsException(message)
38
39 @classmethod
45
46 @classmethod
49
50 @classmethod
54
55 @classmethod
58
59 @classmethod
62
63 @classmethod
66
67 @classmethod
78
79 @classmethod
88
89 @classmethod
91 """ removes blacklisted groups from teams list
92 :type teams: list of str
93 :return: filtered teams
94 :rtype: list of str
95 """
96 blacklist = set(app.config.get("BLACKLISTED_GROUPS", []))
97 return filter(lambda t: t not in blacklist, teams)
98
99 @classmethod
101 if "BLACKLISTED_GROUPS" in app.config:
102 return fas_group in app.config["BLACKLISTED_GROUPS"]
103 else:
104 return False
105