authorizer

package
v1.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 24, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDatasetClaim

func GetDatasetClaim(db core.PostgresAPI, user *dbTable2.User, datasetNodeId string, organizationId int64) (*dataset.Claim, error)

GetDatasetClaim returns the highest role that the user has for a given dataset. This method checks the roles of the dataset, the teams, and the specific user roles.

func GetOrganizationClaim

func GetOrganizationClaim(db core.PostgresAPI, userId int64, organizationId int64) (*organization.Claim, error)

GetOrganizationClaim returns an organization claim for a specific user.

func HasRole

func HasRole(claims Claims, permission permissions.DatasetPermission) bool

HasRole returns a boolean indicating whether the user has the correct permissions.

Types

type Claims

type Claims struct {
	OrgClaim     organization.Claim
	DatasetClaim dataset.Claim
	UserClaim    user.Claim
}

Claims is an object containing claims and user info

func ParseClaims

func ParseClaims(claims map[string]interface{}) *Claims

ParseClaims creates a Claims object from a string map which is returned by the authorizer.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL