permission

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: Apache-2.0 Imports: 7 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"
	AnswerInviteSomeoneToAnswer = "answer.invite_someone_to_answer"
	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"
	AnswerUnDelete              = "answer.undeleted"
	QuestionUnDelete            = "question.undeleted"
	TagUnDelete                 = "tag.undeleted"
)

Variables

This section is empty.

Functions

func GetAnswerPermission

func GetAnswerPermission(ctx context.Context, userID, creatorUserID string,
	status int, canEdit, canDelete, canRecover 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 GetQuestionExtendsPermission added in v1.1.0

func GetQuestionExtendsPermission(ctx context.Context, canInviteOtherToAnswer bool) (
	actions []*schema.PermissionMemberAction)

GetQuestionExtendsPermission get question extends permission

func GetQuestionPermission

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

GetQuestionPermission get question permission

func GetTagPermission

func GetTagPermission(ctx context.Context, status int, canEdit, canDelete, canRecover 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