permission

package
v1.1.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: May 9, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AdminAccess               = "admin.access"
	QuestionAdd               = "question.add"
	QuestionEdit              = "question.edit"
	QuestionEditWithoutReview = "question.edit_without_review"
	QuestionDelete            = "question.delete"
	QuestionClose             = "question.close"
	QuestionReopen            = "question.reopen"
	QuestionVoteUp            = "question.vote_up"
	QuestionVoteDown          = "question.vote_down"
	QuestionPin               = "question.pin"
	QuestionUnPin             = "question.unpin"
	QuestionHide              = "question.hide"
	QuestionShow              = "question.show"
	AnswerAdd                 = "answer.add"
	AnswerEdit                = "answer.edit"
	AnswerEditWithoutReview   = "answer.edit_without_review"
	AnswerDelete              = "answer.delete"
	AnswerAccept              = "answer.accept"
	AnswerVoteUp              = "answer.vote_up"
	AnswerVoteDown            = "answer.vote_down"
	CommentAdd                = "comment.add"
	CommentEdit               = "comment.edit"
	CommentDelete             = "comment.delete"
	CommentVoteUp             = "comment.vote_up"
	CommentVoteDown           = "comment.vote_down"
	ReportAdd                 = "report.add"
	TagAdd                    = "tag.add"
	TagEdit                   = "tag.edit"
	TagEditSlugName           = "tag.edit_slug_name"
	TagEditWithoutReview      = "tag.edit_without_review"
	TagDelete                 = "tag.delete"
	TagSynonym                = "tag.synonym"
	LinkUrlLimit              = "link.url_limit"
	VoteDetail                = "vote.detail"
	AnswerAudit               = "answer.audit"
	QuestionAudit             = "question.audit"
	TagAudit                  = "tag.audit"
	TagUseReservedTag         = "tag.use_reserved_tag"
)

Variables

This section is empty.

Functions

func GetAnswerPermission

func GetAnswerPermission(ctx context.Context, userID string, creatorUserID string, canEdit, canDelete bool) (
	actions []*schema.PermissionMemberAction)

GetAnswerPermission get answer permission

func GetCommentPermission

func GetCommentPermission(ctx context.Context, userID string, creatorUserID string,
	createdAt time.Time, canEdit, canDelete bool) (actions []*schema.PermissionMemberAction)

GetCommentPermission get comment permission

func GetQuestionPermission

func GetQuestionPermission(ctx context.Context, userID string, creatorUserID string,
	canEdit, canDelete, canClose, canReopen, canPin, canHide, CanUnPin, canShow bool) (
	actions []*schema.PermissionMemberAction)

GetQuestionPermission get question permission

func GetTagPermission

func GetTagPermission(ctx context.Context, canEdit, canDelete bool) (
	actions []*schema.PermissionMemberAction)

GetTagPermission get tag permission

func GetTagSynonymPermission added in v0.5.0

func GetTagSynonymPermission(ctx context.Context, canEdit bool) (
	actions []*schema.PermissionMemberAction)

GetTagSynonymPermission get tag synonym permission

Types

This section is empty.

Jump to

Keyboard shortcuts

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