diff --git a/app/classes/shared/controller.py b/app/classes/shared/controller.py index d045b150..9c7e53cf 100644 --- a/app/classes/shared/controller.py +++ b/app/classes/shared/controller.py @@ -152,11 +152,13 @@ class Controller: @staticmethod def can_add_user(user_id): #TODO: Complete if we need a User Addition limit + #return db_helper.can_add_in_crafty(user_id, Enum_Permissions_Crafty.User_Config) return True @staticmethod def can_add_role(user_id): #TODO: Complete if we need a User Addition limit + #return db_helper.can_add_in_crafty(user_id, Enum_Permissions_Crafty.Roles_Config) return True @staticmethod diff --git a/app/classes/shared/models.py b/app/classes/shared/models.py index 5ca6a434..39ac07b4 100644 --- a/app/classes/shared/models.py +++ b/app/classes/shared/models.py @@ -494,7 +494,7 @@ class db_shortcuts: can = crafty_permissions.has_permission(user_crafty.permissions, permission) limit_list = db_helper.get_permission_quantity_list(user_id) quantity_list = db_helper.get_created_quantity_list(user_id) - return can and quantity_list[permission.name] < limit_list[permission.name] + return can and ((quantity_list[permission.name] < limit_list[permission.name]) or limit_list[permission.name] == -1 ) @staticmethod def add_server_creation(user_id): diff --git a/app/classes/web/panel_handler.py b/app/classes/web/panel_handler.py index 930b9ce3..dbb739ba 100644 --- a/app/classes/web/panel_handler.py +++ b/app/classes/web/panel_handler.py @@ -711,7 +711,7 @@ class PanelHandler(BaseHandler): if argument: roles.add(role.role_id) - permissions_mask = "00000000" + permissions_mask = "000" server_quantity = {} for permission in self.controller.list_defined_crafty_permissions(): argument = int(float( @@ -729,7 +729,6 @@ class PanelHandler(BaseHandler): )) if q_argument: server_quantity[permission.name] = q_argument - else: server_quantity[permission.name] = 0 @@ -785,7 +784,7 @@ class PanelHandler(BaseHandler): if argument: roles.add(role.role_id) - permissions_mask = "00000000" + permissions_mask = "000" server_quantity = {} for permission in self.controller.list_defined_crafty_permissions(): argument = int(float( @@ -803,7 +802,6 @@ class PanelHandler(BaseHandler): )) if q_argument: server_quantity[permission.name] = q_argument - else: server_quantity[permission.name] = 0