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 -class UsersLogic(object):
4 @classmethod
5 - def raise_if_cant_update_copr(cls, user, copr, message):
6 """This method raises InsufficientRightsException if given user cant update 7 given copr. Returns None otherwise. 8 """ 9 # TODO: this is a bit inconsistent - shouldn't the user method be called can_update? 10 if not user.can_edit(copr): 11 raise exceptions.InsufficientRightsException(message)
12 13 @classmethod
14 - def raise_if_cant_build_in_copr(cls, user, copr, message):
15 """This method raises InsufficientRightsException if given user cant build in 16 given copr. Returns None otherwise. 17 """ 18 if not user.can_build_in(copr): 19 raise exceptions.InsufficientRightsException(message)
20