def clean_portal_label_on_page(self,user_type): from gflux.apps.station.sql_utils import check_if_user_is_allowed_to_portal tmp_portal=[] for portal in self.portal.site: if check_if_user_is_allowed_to_portal(portal, user_type): tmp_portal.append(portal) return tmp_portal
def check_user_portal_permission(self, username) : from gflux.apps.station.sql_utils import get_user_account_type_by_name from gflux.apps.station.sql_utils import get_enable_advanced_features_by_name from gflux.apps.station.sql_utils import check_if_user_is_allowed_to_portal # 获取用户类型 user_type=get_user_account_type_by_name(username) #get enable_advanced_features enable_advanced_features=get_enable_advanced_features_by_name(username) # 检查该用户类型是否允许访问该portal allowed=check_if_user_is_allowed_to_portal(self, user_type) return (user_type,allowed,enable_advanced_features)