Esempio n. 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()
Esempio n. 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()
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 6
0
 def canAcceptApplication(self, clan):
     return error(_CCR.DEFAULT)
Esempio n. 7
0
 def canSeeTreasury(self, clan):
     return error(_CCR.DEFAULT)
Esempio n. 8
0
 def canDeclineInvite(self, clan):
     return error(_CCR.DEFAULT)
Esempio n. 9
0
 def canRevokeInvite(self, clan):
     return error(_CCR.DEFAULT)
Esempio n. 10
0
 def canDeclineApplication(self, clan):
     return error(_CCR.DEFAULT)
Esempio n. 11
0
 def canRevokeApplication(self, clan):
     return error(_CCR.DEFAULT)
Esempio n. 12
0
 def canHandleClanInvites(self, clan):
     return error(_CCR.DEFAULT)
Esempio n. 13
0
 def canSeeTreasury(self, clan):
     return error(_CCR.DEFAULT)
Esempio n. 14
0
 def canRevokeApplication(self, clan):
     return error(_CCR.DEFAULT)
Esempio n. 15
0
 def canSendApplication(self, clan):
     return error(_CCR.DEFAULT)
Esempio n. 16
0
 def canHandleClanInvites(self, clan):
     return error(_CCR.DEFAULT)
Esempio n. 17
0
 def canSearchClans(self, pattern):
     if not isValidPattern(pattern):
         return error(_CCR.SEARCH_PATTERN_INVALID)
     return self.__checkPermissions('canSeeClans')
Esempio n. 18
0
 def canSearchClans(self, pattern):
     if not isValidPattern(pattern):
         return error(_CCR.SEARCH_PATTERN_INVALID)
     return self.__checkPermissions('canSeeClans')
Esempio n. 19
0
 def canDeclineApplication(self, clan):
     return error(_CCR.DEFAULT)
Esempio n. 20
0
 def canSendApplication(self, clan):
     return error(_CCR.DEFAULT)
Esempio n. 21
0
 def canSendInvite(self, clan):
     return error(_CCR.DEFAULT)
Esempio n. 22
0
 def canAcceptApplication(self, clan):
     return error(_CCR.DEFAULT)
Esempio n. 23
0
 def canRevokeInvite(self, clan):
     return error(_CCR.DEFAULT)
Esempio n. 24
0
 def canSendInvite(self, clan):
     return error(_CCR.DEFAULT)
Esempio n. 25
0
 def canAcceptInvite(self, clan):
     return error(_CCR.DEFAULT)
Esempio n. 26
0
 def canAcceptInvite(self, clan):
     return error(_CCR.DEFAULT)
Esempio n. 27
0
 def canDeclineInvite(self, clan):
     return error(_CCR.DEFAULT)
Esempio n. 28
0
 def canSearchClans(self, pattern):
     return error(_CCR.DEFAULT)
Esempio n. 29
0
 def canSearchClans(self, pattern):
     return error(_CCR.DEFAULT)