cando:具有用户,角色和功能的简单访问权限宝典

时间:2021-05-21 00:23:16
【文件属性】:
文件名称:cando:具有用户,角色和功能的简单访问权限宝典
文件大小:17KB
文件格式:ZIP
更新时间:2021-05-21 00:23:16
Ruby 可以做 CanDo是一个小工具,可根据用户,角色和功能来实现简单的用户访问系统,其中: 每个用户可以拥有0个,1个或多个角色 每个角色可以具有0、1或许多功能 用户可以通过分配角色来获得能力(角色==能力集合)。 在代码中, can使用can helper方法来测试用户是否具有一定的能力(有关有效的代码示例,请参见下文)。 用法示例 在代码中使用CanDo(在空数据库中运行代码): require 'cando' include CanDo CanDo.init do # if passed, this will be executed if the user does not have the # asked-for capability (only applies if 'can' is passed a block) cannot_block do |user_u
【文件预览】:
cando-master
----.gitignore(825B)
----manifest.json(290B)
----README.md(8KB)
----Gemfile(482B)
----.document(55B)
----cando.gemspec(3KB)
----.rspec(8B)
----Gemfile.lock(2KB)
----contrib()
--------initial_schema.rb(880B)
----spec()
--------cando_spec.rb(6KB)
--------spec_helper.rb(1KB)
----LICENSE.txt(1KB)
----.travis.yml(163B)
----VERSION(5B)
----lib()
--------tasks()
--------models()
--------cando.rb(5KB)
----Rakefile(2KB)

网友评论