def update_permissions(username, store_manager): if Owners.is_owner_on_shop(username, store_manager.store_name) is not False: previous_store_manager = StoreManagers.get_store_manager( store_manager.username, store_manager.store_name) status = StoreManagers.update_permissions(store_manager) if status: if isEmptyPermissions(previous_store_manager): status = HistoryAppointings.update_history_appointing( username, store_manager.username, store_manager.store_name, getPermissionsString(store_manager)) return status return False
def remove_store_manager(username, shop_name, target_id): if Owners.is_owner_on_shop(username, shop_name) is not False: return StoreManagers.remove_manager_from_shop(target_id, shop_name) return False
def is_owner_on_shop(username, shop_name): return Owners.is_owner_on_shop(username, shop_name)