Documentation ¶
Overview ¶
Copyright (C) 2023 Tim Bastin, l3montree UG (haftungsbeschränkt)
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Index ¶
Constants ¶
const ( RoleOwner = "owner" RoleAdmin = "admin" RoleMember = "member" )
Variables ¶
This section is empty.
Functions ¶
func NewCasbinRBACProvider ¶
the provider can be used to create domain specific RBAC instances
Types ¶
type AccessControl ¶
type AccessControl interface { HasAccess(subject string) bool InheritRole(roleWhichGetsPermissions, roleWhichProvidesPermissions string) error GetAllRoles(user string) []string GrantRole(subject string, role string) error RevokeRole(subject string, role string) error GrantRoleInProject(subject string, role string, project string) error RevokeRoleInProject(subject string, role string, project string) error InheritProjectRole(roleWhichGetsPermissions, roleWhichProvidesPermissions string, project string) error LinkDomainAndProjectRole(domainRoleWhichGetsPermission, projectRoleWhichProvidesPermissions string, project string) error AllowRole(role string, object string, action []Action) error IsAllowed(subject string, object string, action Action) (bool, error) IsAllowedInProject(project, user string, object string, action Action) (bool, error) AllowRoleInProject(project string, role string, object string, action []Action) error GetAllProjectsForUser(user string) []string }
type RBACMiddleware ¶
type RBACProvider ¶
type RBACProvider interface { GetDomainRBAC(domain string) AccessControl DomainsOfUser(user string) ([]string, error) }