Go的角色访问控制 goRBAC

码农软件 · 软件分类 · 安全相关框架 · 2019-10-02 10:13:14

软件介绍

goRBAC 为 Go 语言应用提供了轻量级的基于角色的访问控制。

该包适用于:

* 实体具有一个或多个角色
* 角色需要分配权限
* 权限需要分配给角色

因此,RBAC 具有以下模型:

* 在实体和角色之间具有多对多关系
* 在角色和权限之间具有多对多关系
* 角色可以具有父角色(权限继承)

示例代码:

import github.com/mikespook/gorbac

rbac := gorbac.New()

rbac := gorbac.NewWithFactory(YourOwnFactory)

rbac.Add("editor", []string{"edit.article"}, nil)   
rbac.Set("master", []string{"del.article"}, []string{"editor"})

rbac.IsGranted("editor", "edit.article", nil)

本文地址:https://codercto.com/soft/d/15861.html

Data-intensive Text Processing With Mapreduce

Data-intensive Text Processing With Mapreduce

Jimmy Lin、Chris Dyer / Morgan and Claypool Publishers / 2010-4-30 / USD 40.00

Our world is being revolutionized by data-driven methods: access to large amounts of data has generated new insights and opened exciting new opportunities in commerce, science, and computing applicati......一起来看看 《Data-intensive Text Processing With Mapreduce》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具