Beispiel #1
0
Datei: ui.py Projekt: laoyin/nyf
    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
Beispiel #2
0
    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
Beispiel #3
0
Datei: ui.py Projekt: laoyin/nyf
    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)
Beispiel #4
0
    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)