donglu9872 2013-04-01 06:22
浏览 34

重新加载会话值

zend framework how to reload session while submit the action.

user may have more than one user level permission,

i have form which contain user rights in check box,
i want to reload session values who are all currently logged in the web.

Example:am admin, currently x and y users are logged in in to the web and doing some activities, their rights are admin, super admin user rights,

i am admin i want to remove their super admin rights, if the made change than these rights changes should change immediately who currently access the web site users also.

How to achieve this in zend.

  • 写回答

1条回答 默认 最新

  • douqi2804 2013-04-01 08:39
    关注

    If I understand correctly, it sounds like you want to update privileges/permissions associated to a role (admin, super-admin, etc) and then have those updated permissions apply to all users with that role, even the ones who are already logged-in.

    This is actually not a ZF-specific problem. It relates more to how you structure your session handling, in particular, whether you store the user's roles/permissions in the session, whether you query the db/datastore for those, etc.

    If you store only the core user info in the session and you query for roles and permissions on each request (probably the least performant of the options), then your problem is solved. The roles and permissions have been updated in the datastore and will be reflected when you query for them.

    Alternatively, if you also store the roles and permissions in the session, then you need to iterate over all active sessions, updating privileges in sessions affected by the new role. While this is technically do-able with file-based sessions, it is usually done using db-based storage for your session.

    As noted elsewhere, Zend_Session and Zend_Acl are the components providing all this functionality. But the decision on core architecture has to precede implementation with these components.

    评论

报告相同问题?

悬赏问题

  • ¥15 我的数据无法存进链表里
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大
  • ¥15 Oracle中如何从clob类型截取特定字符串后面的字符
  • ¥15 想通过pywinauto自动电机应用程序按钮,但是找不到应用程序按钮信息
  • ¥15 如何在炒股软件中,爬到我想看的日k线
  • ¥15 seatunnel 怎么配置Elasticsearch
  • ¥15 PSCAD安装问题 ERROR: Visual Studio 2013, 2015, 2017 or 2019 is not found in the system.
  • ¥15 (标签-MATLAB|关键词-多址)
  • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
  • ¥500 52810做蓝牙接受端