Beispiel #1
0
 def __checkPermissions(self, permName, clan = None):
     perms = self.__profile.getPermissions(clan)
     if not hasattr(perms, permName):
         LOG_WARNING('There is error while checking account clan permissions', clan, permName)
         return error(_CCR.DEFAULT)
     if not getattr(perms, permName)():
         return error(_CCR.DEFAULT)
     return success()
Beispiel #2
0
 def __checkPermissions(self, permName, clan = None):
     perms = self.__profile.getPermissions(clan)
     if not hasattr(perms, permName):
         LOG_WARNING('There is error while checking account clan permissions', clan, permName)
         return error(_CCR.DEFAULT)
     if not getattr(perms, permName)():
         return error(_CCR.DEFAULT)
     return success()
Beispiel #3
0
 def canSendApplication(self, clan):
     if self.__profile.isInClan():
         if self.__profile.getClanDbID() == clan.getDbID():
             return error(_CCR.OWN_CLAN)
         return error(_CCR.ALREADY_IN_CLAN)
     if self.__profile.hasClanInvite(clan.getDbID()):
         return error(_CCR.CLAN_INVITE_ALREADY_RECEIVED)
     if self.__profile.isClanApplicationSent(clan.getDbID()):
         return error(_CCR.CLAN_APPLICATION_ALREADY_SENT)
     if self.__profile.isInvitesLimitReached():
         return error(_CCR.SENT_INVITES_LIMIT_REACHED)
     if not clan.canAcceptsJoinRequests():
         return error(_CCR.CLAN_CONSCRIPTION_CLOSED)
     if not self.__profile.getPermissions(clan).isValidAccountType():
         return error(_CCR.FORBIDDEN_ACCOUNT_TYPE)
     if not clan.hasFreePlaces():
         return error(_CCR.CLAN_IS_FULL)
     return error(_CCR.CLAN_ENTER_COOLDOWN) if self.__profile.isInClanEnterCooldown() else self.__checkPermissions('canSendApplication', clan)
Beispiel #4
0
 def canSendApplication(self, clan):
     if self.__profile.isInClan():
         if self.__profile.getClanDbID() == clan.getDbID():
             return error(_CCR.OWN_CLAN)
         else:
             return error(_CCR.ALREADY_IN_CLAN)
     if self.__profile.hasClanInvite(clan.getDbID()):
         return error(_CCR.CLAN_INVITE_ALREADY_RECEIVED)
     if self.__profile.isClanApplicationSent(clan.getDbID()):
         return error(_CCR.CLAN_APPLICATION_ALREADY_SENT)
     if self.__profile.isInClanEnterCooldown():
         return error(_CCR.CLAN_LEAVE_COOLDOWN)
     if self.__profile.isInvitesLimitReached():
         return error(_CCR.SENT_INVITES_LIMIT_REACHED)
     if not clan.canAcceptsJoinRequests():
         return error(_CCR.CLAN_CONSCRIPTION_CLOSED)
     if not self.__profile.getPermissions(clan).isValidAccountType():
         return error(_CCR.FORBIDDEN_ACCOUNT_TYPE)
     if not clan.hasFreePlaces():
         return error(_CCR.CLAN_IS_FULL)
     return self.__checkPermissions('canSendApplication', clan)
Beispiel #5
0
 def canSendApplication(self, clan):
     if self.__profile.isInClan():
         if self.__profile.getClanDbID() == clan.getDbID():
             return error(_CCR.OWN_CLAN)
         else:
             return error(_CCR.ALREADY_IN_CLAN)
     if self.__profile.hasClanInvite(clan.getDbID()):
         return error(_CCR.CLAN_INVITE_ALREADY_RECEIVED)
     if self.__profile.isClanApplicationSent(clan.getDbID()):
         return error(_CCR.CLAN_APPLICATION_ALREADY_SENT)
     if self.__profile.isInClanEnterCooldown():
         return error(_CCR.CLAN_LEAVE_COOLDOWN)
     if self.__profile.getApplicationsCount() >= MAX_ACCOUNT_APPLICATIONS_COUNT:
         return error(_CCR.SENT_INVITES_LIMIT_REACHED)
     if not clan.canAcceptsJoinRequests():
         return error(_CCR.CLAN_CONSCRIPTION_CLOSED)
     return self.__checkPermissions('canSendApplication', clan)
Beispiel #6
0
 def canAcceptApplication(self, clan):
     return error(_CCR.DEFAULT)
Beispiel #7
0
 def canSeeTreasury(self, clan):
     return error(_CCR.DEFAULT)
Beispiel #8
0
 def canDeclineInvite(self, clan):
     return error(_CCR.DEFAULT)
Beispiel #9
0
 def canRevokeInvite(self, clan):
     return error(_CCR.DEFAULT)
Beispiel #10
0
 def canDeclineApplication(self, clan):
     return error(_CCR.DEFAULT)
Beispiel #11
0
 def canRevokeApplication(self, clan):
     return error(_CCR.DEFAULT)
Beispiel #12
0
 def canHandleClanInvites(self, clan):
     return error(_CCR.DEFAULT)
Beispiel #13
0
 def canSeeTreasury(self, clan):
     return error(_CCR.DEFAULT)
Beispiel #14
0
 def canRevokeApplication(self, clan):
     return error(_CCR.DEFAULT)
Beispiel #15
0
 def canSendApplication(self, clan):
     return error(_CCR.DEFAULT)
Beispiel #16
0
 def canHandleClanInvites(self, clan):
     return error(_CCR.DEFAULT)
Beispiel #17
0
 def canSearchClans(self, pattern):
     if not isValidPattern(pattern):
         return error(_CCR.SEARCH_PATTERN_INVALID)
     return self.__checkPermissions('canSeeClans')
Beispiel #18
0
 def canSearchClans(self, pattern):
     if not isValidPattern(pattern):
         return error(_CCR.SEARCH_PATTERN_INVALID)
     return self.__checkPermissions('canSeeClans')
Beispiel #19
0
 def canDeclineApplication(self, clan):
     return error(_CCR.DEFAULT)
Beispiel #20
0
 def canSendApplication(self, clan):
     return error(_CCR.DEFAULT)
Beispiel #21
0
 def canSendInvite(self, clan):
     return error(_CCR.DEFAULT)
Beispiel #22
0
 def canAcceptApplication(self, clan):
     return error(_CCR.DEFAULT)
Beispiel #23
0
 def canRevokeInvite(self, clan):
     return error(_CCR.DEFAULT)
Beispiel #24
0
 def canSendInvite(self, clan):
     return error(_CCR.DEFAULT)
Beispiel #25
0
 def canAcceptInvite(self, clan):
     return error(_CCR.DEFAULT)
Beispiel #26
0
 def canAcceptInvite(self, clan):
     return error(_CCR.DEFAULT)
Beispiel #27
0
 def canDeclineInvite(self, clan):
     return error(_CCR.DEFAULT)
Beispiel #28
0
 def canSearchClans(self, pattern):
     return error(_CCR.DEFAULT)
Beispiel #29
0
 def canSearchClans(self, pattern):
     return error(_CCR.DEFAULT)