permission

package
v0.0.0-...-e59a564 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func CurrentUserHasGroupCreate

func CurrentUserHasGroupCreate(ctx context.Context, client *ent.Client, objectID uuid.UUID) (bool, error)

CurrentUserHasGroupCreate reports whether the current user (pulled from context) can create groups. Use github.com/google/uuid.Nil to denote a wildcard object ID.

func CurrentUserHasGroupDelete

func CurrentUserHasGroupDelete(ctx context.Context, client *ent.Client, objectID uuid.UUID) (bool, error)

CurrentUserHasGroupDelete reports whether the current user (pulled from context) can delete a given group. Use github.com/google/uuid.Nil to denote a wildcard object ID.

func CurrentUserHasGroupGet

func CurrentUserHasGroupGet(ctx context.Context, client *ent.Client, objectID uuid.UUID) (bool, error)

CurrentUserHasGroupGet reports whether the current user (pulled from context) can get a given group. Use github.com/google/uuid.Nil to denote a wildcard object ID.

func CurrentUserHasGroupList

func CurrentUserHasGroupList(ctx context.Context, client *ent.Client, objectID uuid.UUID) (bool, error)

CurrentUserHasGroupList reports whether the current user (pulled from context) can list all groups (only compatible with wildcard id *). Use github.com/google/uuid.Nil to denote a wildcard object ID.

func CurrentUserHasGroupUpdate

func CurrentUserHasGroupUpdate(ctx context.Context, client *ent.Client, objectID uuid.UUID) (bool, error)

CurrentUserHasGroupUpdate reports whether the current user (pulled from context) can update a given group. Use github.com/google/uuid.Nil to denote a wildcard object ID.

func CurrentUserHasPermission

func CurrentUserHasPermission(ctx context.Context, client *ent.Client, objectType grantedpermission.ObjectType, objectID uuid.UUID, action actions.PermissionAction) (bool, error)

CurrentUserHasPermission reports whether the current user (pulled from context) has a given permission for action on object. Use github.com/google/uuid.Nil to denote a wildcard object ID.

func CurrentUserHasPermissionGet

func CurrentUserHasPermissionGet(ctx context.Context, client *ent.Client, objectID uuid.UUID) (bool, error)

CurrentUserHasPermissionGet reports whether the current user (pulled from context) can get a given permission. Use github.com/google/uuid.Nil to denote a wildcard object ID.

func CurrentUserHasPermissionGrant

func CurrentUserHasPermissionGrant(ctx context.Context, client *ent.Client, objectID uuid.UUID) (bool, error)

CurrentUserHasPermissionGrant reports whether the current user (pulled from context) can grant permissions (only compatible with wildcard id *). Use github.com/google/uuid.Nil to denote a wildcard object ID.

func CurrentUserHasPermissionList

func CurrentUserHasPermissionList(ctx context.Context, client *ent.Client, objectID uuid.UUID) (bool, error)

CurrentUserHasPermissionList reports whether the current user (pulled from context) can list all permissions (only compatible with wildcard id *). Use github.com/google/uuid.Nil to denote a wildcard object ID.

func CurrentUserHasPermissionRevoke

func CurrentUserHasPermissionRevoke(ctx context.Context, client *ent.Client, objectID uuid.UUID) (bool, error)

CurrentUserHasPermissionRevoke reports whether the current user (pulled from context) can revoke permissions (only compatible with wildcard id *). Use github.com/google/uuid.Nil to denote a wildcard object ID.

func CurrentUserHasProjectCreate

func CurrentUserHasProjectCreate(ctx context.Context, client *ent.Client, objectID uuid.UUID) (bool, error)

CurrentUserHasProjectCreate reports whether the current user (pulled from context) can create projects (only compatible with wildcard id *). Use github.com/google/uuid.Nil to denote a wildcard object ID.

func CurrentUserHasProjectDelete

func CurrentUserHasProjectDelete(ctx context.Context, client *ent.Client, objectID uuid.UUID) (bool, error)

CurrentUserHasProjectDelete reports whether the current user (pulled from context) can delete a given project. Use github.com/google/uuid.Nil to denote a wildcard object ID.

func CurrentUserHasProjectList

func CurrentUserHasProjectList(ctx context.Context, client *ent.Client, objectID uuid.UUID) (bool, error)

CurrentUserHasProjectList reports whether the current user (pulled from context) can list all projects (only compatible with wildcard id *). Use github.com/google/uuid.Nil to denote a wildcard object ID.

func CurrentUserHasProjectUpdate

func CurrentUserHasProjectUpdate(ctx context.Context, client *ent.Client, objectID uuid.UUID) (bool, error)

CurrentUserHasProjectUpdate reports whether the current user (pulled from context) can update a given project. Use github.com/google/uuid.Nil to denote a wildcard object ID.

func CurrentUserHasProjectUpdateMembership

func CurrentUserHasProjectUpdateMembership(ctx context.Context, client *ent.Client, objectID uuid.UUID) (bool, error)

CurrentUserHasProjectUpdateMembership reports whether the current user (pulled from context) can modify project memberships. Use github.com/google/uuid.Nil to denote a wildcard object ID.

func CurrentUserHasProviderConfigure

func CurrentUserHasProviderConfigure(ctx context.Context, client *ent.Client, objectID uuid.UUID) (bool, error)

CurrentUserHasProviderConfigure reports whether the current user (pulled from context) can configure a given provider. Use github.com/google/uuid.Nil to denote a wildcard object ID.

func CurrentUserHasProviderCreate

func CurrentUserHasProviderCreate(ctx context.Context, client *ent.Client, objectID uuid.UUID) (bool, error)

CurrentUserHasProviderCreate reports whether the current user (pulled from context) can create providers. Use github.com/google/uuid.Nil to denote a wildcard object ID.

func CurrentUserHasProviderDelete

func CurrentUserHasProviderDelete(ctx context.Context, client *ent.Client, objectID uuid.UUID) (bool, error)

CurrentUserHasProviderDelete reports whether the current user (pulled from context) can delete a given provider. Use github.com/google/uuid.Nil to denote a wildcard object ID.

func CurrentUserHasProviderGet

func CurrentUserHasProviderGet(ctx context.Context, client *ent.Client, objectID uuid.UUID) (bool, error)

CurrentUserHasProviderGet reports whether the current user (pulled from context) can get a given provider. Use github.com/google/uuid.Nil to denote a wildcard object ID.

func CurrentUserHasProviderList

func CurrentUserHasProviderList(ctx context.Context, client *ent.Client, objectID uuid.UUID) (bool, error)

CurrentUserHasProviderList reports whether the current user (pulled from context) can list all providers (only compatible with wildcard id *). Use github.com/google/uuid.Nil to denote a wildcard object ID.

func CurrentUserHasProviderLoad

func CurrentUserHasProviderLoad(ctx context.Context, client *ent.Client, objectID uuid.UUID) (bool, error)

CurrentUserHasProviderLoad reports whether the current user (pulled from context) can load a given provider. Use github.com/google/uuid.Nil to denote a wildcard object ID.

func CurrentUserHasProviderUnload

func CurrentUserHasProviderUnload(ctx context.Context, client *ent.Client, objectID uuid.UUID) (bool, error)

CurrentUserHasProviderUnload reports whether the current user (pulled from context) can unload a given provider. Use github.com/google/uuid.Nil to denote a wildcard object ID.

func CurrentUserHasProviderUpdate

func CurrentUserHasProviderUpdate(ctx context.Context, client *ent.Client, objectID uuid.UUID) (bool, error)

CurrentUserHasProviderUpdate reports whether the current user (pulled from context) can update a given provider. Use github.com/google/uuid.Nil to denote a wildcard object ID.

func CurrentUserHasUserCreate

func CurrentUserHasUserCreate(ctx context.Context, client *ent.Client, objectID uuid.UUID) (bool, error)

CurrentUserHasUserCreate reports whether the current user (pulled from context) can create users. Use github.com/google/uuid.Nil to denote a wildcard object ID.

func CurrentUserHasUserDelete

func CurrentUserHasUserDelete(ctx context.Context, client *ent.Client, objectID uuid.UUID) (bool, error)

CurrentUserHasUserDelete reports whether the current user (pulled from context) can delete a given user. Use github.com/google/uuid.Nil to denote a wildcard object ID.

func CurrentUserHasUserGet

func CurrentUserHasUserGet(ctx context.Context, client *ent.Client, objectID uuid.UUID) (bool, error)

CurrentUserHasUserGet reports whether the current user (pulled from context) can get a given user. Use github.com/google/uuid.Nil to denote a wildcard object ID.

func CurrentUserHasUserList

func CurrentUserHasUserList(ctx context.Context, client *ent.Client, objectID uuid.UUID) (bool, error)

CurrentUserHasUserList reports whether the current user (pulled from context) can list all users (only compatible with wildcard id *). Use github.com/google/uuid.Nil to denote a wildcard object ID.

func CurrentUserHasUserUpdate

func CurrentUserHasUserUpdate(ctx context.Context, client *ent.Client, objectID uuid.UUID) (bool, error)

CurrentUserHasUserUpdate reports whether the current user (pulled from context) can update a given user. Use github.com/google/uuid.Nil to denote a wildcard object ID.

func DisplayString

func DisplayString(subjectType grantedpermission.SubjectType, subjectID uuid.UUID, objectType grantedpermission.ObjectType, objectID uuid.UUID, action actions.PermissionAction) string

func GrantPermission

func GrantPermission(ctx context.Context, client *ent.Client, subjectType grantedpermission.SubjectType, subjectID uuid.UUID, objectType grantedpermission.ObjectType, objectID uuid.UUID, action actions.PermissionAction) (*ent.GrantedPermission, error)

func HasGroupCreate

func HasGroupCreate(ctx context.Context, client *ent.Client, entUser *ent.User, objectID uuid.UUID) (bool, error)

HasGroupCreate reports whether a given user can create groups. Use github.com/google/uuid.Nil to denote a wildcard object ID.

func HasGroupDelete

func HasGroupDelete(ctx context.Context, client *ent.Client, entUser *ent.User, objectID uuid.UUID) (bool, error)

HasGroupDelete reports whether a given user can delete a given group. Use github.com/google/uuid.Nil to denote a wildcard object ID.

func HasGroupGet

func HasGroupGet(ctx context.Context, client *ent.Client, entUser *ent.User, objectID uuid.UUID) (bool, error)

HasGroupGet reports whether a given user can get a given group. Use github.com/google/uuid.Nil to denote a wildcard object ID.

func HasGroupList

func HasGroupList(ctx context.Context, client *ent.Client, entUser *ent.User, objectID uuid.UUID) (bool, error)

HasGroupList reports whether a given user can list all groups (only compatible with wildcard id *). Use github.com/google/uuid.Nil to denote a wildcard object ID.

func HasGroupUpdate

func HasGroupUpdate(ctx context.Context, client *ent.Client, entUser *ent.User, objectID uuid.UUID) (bool, error)

HasGroupUpdate reports whether a given user can update a given group. Use github.com/google/uuid.Nil to denote a wildcard object ID.

func HasPermission

func HasPermission(ctx context.Context, client *ent.Client, entUser *ent.User, objectType grantedpermission.ObjectType, objectID uuid.UUID, action actions.PermissionAction) (bool, error)

HasPermission reports whether a given user has a given permission for action on object. Use github.com/google/uuid.Nil to denote a wildcard object ID.

func HasPermissionGet

func HasPermissionGet(ctx context.Context, client *ent.Client, entUser *ent.User, objectID uuid.UUID) (bool, error)

HasPermissionGet reports whether a given user can get a given permission. Use github.com/google/uuid.Nil to denote a wildcard object ID.

func HasPermissionGrant

func HasPermissionGrant(ctx context.Context, client *ent.Client, entUser *ent.User, objectID uuid.UUID) (bool, error)

HasPermissionGrant reports whether a given user can grant permissions (only compatible with wildcard id *). Use github.com/google/uuid.Nil to denote a wildcard object ID.

func HasPermissionList

func HasPermissionList(ctx context.Context, client *ent.Client, entUser *ent.User, objectID uuid.UUID) (bool, error)

HasPermissionList reports whether a given user can list all permissions (only compatible with wildcard id *). Use github.com/google/uuid.Nil to denote a wildcard object ID.

func HasPermissionRevoke

func HasPermissionRevoke(ctx context.Context, client *ent.Client, entUser *ent.User, objectID uuid.UUID) (bool, error)

HasPermissionRevoke reports whether a given user can revoke permissions (only compatible with wildcard id *). Use github.com/google/uuid.Nil to denote a wildcard object ID.

func HasProjectCreate

func HasProjectCreate(ctx context.Context, client *ent.Client, entUser *ent.User, objectID uuid.UUID) (bool, error)

HasProjectCreate reports whether a given user can create projects (only compatible with wildcard id *). Use github.com/google/uuid.Nil to denote a wildcard object ID.

func HasProjectDelete

func HasProjectDelete(ctx context.Context, client *ent.Client, entUser *ent.User, objectID uuid.UUID) (bool, error)

HasProjectDelete reports whether a given user can delete a given project. Use github.com/google/uuid.Nil to denote a wildcard object ID.

func HasProjectList

func HasProjectList(ctx context.Context, client *ent.Client, entUser *ent.User, objectID uuid.UUID) (bool, error)

HasProjectList reports whether a given user can list all projects (only compatible with wildcard id *). Use github.com/google/uuid.Nil to denote a wildcard object ID.

func HasProjectUpdate

func HasProjectUpdate(ctx context.Context, client *ent.Client, entUser *ent.User, objectID uuid.UUID) (bool, error)

HasProjectUpdate reports whether a given user can update a given project. Use github.com/google/uuid.Nil to denote a wildcard object ID.

func HasProjectUpdateMembership

func HasProjectUpdateMembership(ctx context.Context, client *ent.Client, entUser *ent.User, objectID uuid.UUID) (bool, error)

HasProjectUpdateMembership reports whether a given user can modify project memberships. Use github.com/google/uuid.Nil to denote a wildcard object ID.

func HasProviderConfigure

func HasProviderConfigure(ctx context.Context, client *ent.Client, entUser *ent.User, objectID uuid.UUID) (bool, error)

HasProviderConfigure reports whether a given user can configure a given provider. Use github.com/google/uuid.Nil to denote a wildcard object ID.

func HasProviderCreate

func HasProviderCreate(ctx context.Context, client *ent.Client, entUser *ent.User, objectID uuid.UUID) (bool, error)

HasProviderCreate reports whether a given user can create providers. Use github.com/google/uuid.Nil to denote a wildcard object ID.

func HasProviderDelete

func HasProviderDelete(ctx context.Context, client *ent.Client, entUser *ent.User, objectID uuid.UUID) (bool, error)

HasProviderDelete reports whether a given user can delete a given provider. Use github.com/google/uuid.Nil to denote a wildcard object ID.

func HasProviderGet

func HasProviderGet(ctx context.Context, client *ent.Client, entUser *ent.User, objectID uuid.UUID) (bool, error)

HasProviderGet reports whether a given user can get a given provider. Use github.com/google/uuid.Nil to denote a wildcard object ID.

func HasProviderList

func HasProviderList(ctx context.Context, client *ent.Client, entUser *ent.User, objectID uuid.UUID) (bool, error)

HasProviderList reports whether a given user can list all providers (only compatible with wildcard id *). Use github.com/google/uuid.Nil to denote a wildcard object ID.

func HasProviderLoad

func HasProviderLoad(ctx context.Context, client *ent.Client, entUser *ent.User, objectID uuid.UUID) (bool, error)

HasProviderLoad reports whether a given user can load a given provider. Use github.com/google/uuid.Nil to denote a wildcard object ID.

func HasProviderUnload

func HasProviderUnload(ctx context.Context, client *ent.Client, entUser *ent.User, objectID uuid.UUID) (bool, error)

HasProviderUnload reports whether a given user can unload a given provider. Use github.com/google/uuid.Nil to denote a wildcard object ID.

func HasProviderUpdate

func HasProviderUpdate(ctx context.Context, client *ent.Client, entUser *ent.User, objectID uuid.UUID) (bool, error)

HasProviderUpdate reports whether a given user can update a given provider. Use github.com/google/uuid.Nil to denote a wildcard object ID.

func HasUserCreate

func HasUserCreate(ctx context.Context, client *ent.Client, entUser *ent.User, objectID uuid.UUID) (bool, error)

HasUserCreate reports whether a given user can create users. Use github.com/google/uuid.Nil to denote a wildcard object ID.

func HasUserDelete

func HasUserDelete(ctx context.Context, client *ent.Client, entUser *ent.User, objectID uuid.UUID) (bool, error)

HasUserDelete reports whether a given user can delete a given user. Use github.com/google/uuid.Nil to denote a wildcard object ID.

func HasUserGet

func HasUserGet(ctx context.Context, client *ent.Client, entUser *ent.User, objectID uuid.UUID) (bool, error)

HasUserGet reports whether a given user can get a given user. Use github.com/google/uuid.Nil to denote a wildcard object ID.

func HasUserList

func HasUserList(ctx context.Context, client *ent.Client, entUser *ent.User, objectID uuid.UUID) (bool, error)

HasUserList reports whether a given user can list all users (only compatible with wildcard id *). Use github.com/google/uuid.Nil to denote a wildcard object ID.

func HasUserUpdate

func HasUserUpdate(ctx context.Context, client *ent.Client, entUser *ent.User, objectID uuid.UUID) (bool, error)

HasUserUpdate reports whether a given user can update a given user. Use github.com/google/uuid.Nil to denote a wildcard object ID.

func RevokePermission

func RevokePermission(ctx context.Context, client *ent.Client, subjectType grantedpermission.SubjectType, subjectID uuid.UUID, objectType grantedpermission.ObjectType, objectID uuid.UUID, action actions.PermissionAction) error

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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