Documentation ¶
Index ¶
- func HighestPermissionsForRoles(rolesIDs []string, rm gimlet.RoleManager, opts gimlet.PermissionOpts) (gimlet.Permissions, error)
- func HighestPermissionsForRolesAndResourceType(roleIDs []string, resourceType string, rm gimlet.RoleManager) (map[string]gimlet.Permissions, error)
- func MakeRoleWithPermissions(rm gimlet.RoleManager, resourceType string, resources []string, ...) (*gimlet.Role, error)
- func NewInMemoryRoleManager() gimlet.RoleManager
- func NewMongoBackedRoleManager(opts MongoBackedRoleManagerOpts) gimlet.RoleManager
- type MongoBackedRoleManagerOpts
- type PermissionSummary
- type PermissionsForResources
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HighestPermissionsForRoles ¶
func HighestPermissionsForRoles(rolesIDs []string, rm gimlet.RoleManager, opts gimlet.PermissionOpts) (gimlet.Permissions, error)
HighestPermissionsForRoles takes in a list of roles and returns an aggregated list of the highest levels for all permissions
func HighestPermissionsForRolesAndResourceType ¶
func HighestPermissionsForRolesAndResourceType(roleIDs []string, resourceType string, rm gimlet.RoleManager) (map[string]gimlet.Permissions, error)
HighestPermissionsForResourceType takes a list of role IDs, a resource type, and a role manager and returns a mapping of all resource IDs for the given roles to their highest permissions based on those roles.
func MakeRoleWithPermissions ¶
func MakeRoleWithPermissions(rm gimlet.RoleManager, resourceType string, resources []string, permissions gimlet.Permissions) (*gimlet.Role, error)
func NewInMemoryRoleManager ¶
func NewInMemoryRoleManager() gimlet.RoleManager
func NewMongoBackedRoleManager ¶
func NewMongoBackedRoleManager(opts MongoBackedRoleManagerOpts) gimlet.RoleManager
Types ¶
type PermissionSummary ¶
type PermissionSummary struct { Type string `json:"type"` Permissions PermissionsForResources `json:"permissions"` }
func PermissionSummaryForRoles ¶
func PermissionSummaryForRoles(ctx context.Context, rolesIDs []string, rm gimlet.RoleManager) ([]PermissionSummary, error)
type PermissionsForResources ¶
type PermissionsForResources map[string]gimlet.Permissions
Click to show internal directories.
Click to hide internal directories.