Package coprs :: Package logic :: Module users_logic
[hide private]
[frames] | no frames]

Source Code for Module coprs.logic.users_logic

 1  from coprs import exceptions 
2 3 4 -class UsersLogic(object):
5 6 @classmethod
7 - def raise_if_cant_update_copr(cls, user, copr, message):
8 """ 9 Raise InsufficientRightsException if given user cant update 10 given copr. Return None otherwise. 11 """ 12 13 # TODO: this is a bit inconsistent - shouldn't the user method be 14 # called can_update? 15 if not user.can_edit(copr): 16 raise exceptions.InsufficientRightsException(message)
17 18 @classmethod
19 - def raise_if_cant_build_in_copr(cls, user, copr, message):
20 """ 21 Raises InsufficientRightsException if given user cant build in 22 given copr. Return None otherwise. 23 """ 24 25 if not user.can_build_in(copr): 26 raise exceptions.InsufficientRightsException(message)
27