示例#1
0
文件: base.py 项目: fdgonthier/kas
    def _check_workspace_prop(self, controller, action):

        if 'user_id' in session and session['user_id'] or c.workspace.public:

            # Detect if workspace is frozen.
            c.workspace_frozen = bool(c.workspace.frozen or c.workspace.deep_frozen)

            # Show actions list.
            show_actions = [('teambox', 'show'), ('admin_teambox', 'show'), ('skurl_teambox', 'show')]

            # Ajust permissions depending on weither workspace is frozen or not.
            if c.workspace_frozen:
                if not c.perms.hasRole('freeze'):
                    log.debug("_check_workspace_prop(): workspace is now frozen.")
                    c.perms.addRole('freeze')
                    session.save()
                    if (controller, action) not in show_actions:
                        # Only show change in non-show actions.
                        ui_warn(code='workspace_now_frozen', hide_after_ms=5000)
                if (controller, action) in show_actions:
                    # Always show frozen message in show actions.
                    ui_warn(code='workspace_is_frozen', hide_after_ms=5000)
        
            if not c.workspace_frozen and c.perms.hasRole('freeze'):
                log.debug("_check_workspace_prop(): workspace is no longer frozen.")
                c.perms.dropRole('freeze')
                session.save()
                if (controller, action) not in show_actions:
                     # Only show change in non-show actions.
                    ui_info(code='workspace_now_unfrozen', hide_after_ms=5000)
示例#2
0
    def _check_workspace_prop(self, controller, action):

        if 'user_id' in session and session['user_id'] or c.workspace.public:

            # Detect if workspace is frozen.
            c.workspace_frozen = bool(c.workspace.frozen
                                      or c.workspace.deep_frozen)

            # Show actions list.
            show_actions = [('teambox', 'show'), ('admin_teambox', 'show'),
                            ('skurl_teambox', 'show')]

            # Ajust permissions depending on weither workspace is frozen or not.
            if c.workspace_frozen:
                if not c.perms.hasRole('freeze'):
                    log.debug(
                        "_check_workspace_prop(): workspace is now frozen.")
                    c.perms.addRole('freeze')
                    session.save()
                    if (controller, action) not in show_actions:
                        # Only show change in non-show actions.
                        ui_warn(code='workspace_now_frozen',
                                hide_after_ms=5000)
                if (controller, action) in show_actions:
                    # Always show frozen message in show actions.
                    ui_warn(code='workspace_is_frozen', hide_after_ms=5000)

            if not c.workspace_frozen and c.perms.hasRole('freeze'):
                log.debug(
                    "_check_workspace_prop(): workspace is no longer frozen.")
                c.perms.dropRole('freeze')
                session.save()
                if (controller, action) not in show_actions:
                    # Only show change in non-show actions.
                    ui_info(code='workspace_now_unfrozen', hide_after_ms=5000)
示例#3
0
文件: message.py 项目: fdgonthier/kas
 def showold(self, code):
     ui_warn(code=code)
     return render('message/show.mako')
示例#4
0
 def showold(self, code):
     ui_warn(code=code)
     return render('message/show.mako')