gf_policy

package
v0.0.0-...-a1b0e2b Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: GPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GF_POLICY_OP__FLOW_GET = "gf:images:flow_get"

	GF_POLICY_OP__FLOW_ADD_TAG         = "gf:images:flow_add_tag"
	GF_POLICY_OP__FLOW_REMOVE_TAG      = "gf:images:flow_remove_tag"
	GF_POLICY_OP__FLOW_ADD_IMG_TAG     = "gf:images:flow_add_img_tag"
	GF_POLICY_OP__FLOW_REMOVE_IMG_TAG  = "gf:images:flow_remove_img_tag"
	GF_POLICY_OP__FLOW_ADD_IMG_NOTE    = "gf:images:flow_add_img_note"
	GF_POLICY_OP__FLOW_REMOVE_IMG_NOTE = "gf:images:flow_remove_img_note"

	GF_POLICY_OP__FLOW_ADD_IMG    = "gf:images:flow_add_img"
	GF_POLICY_OP__FLOW_REMOVE_IMG = "gf:images:flow_remove_img"

	GF_POLICY_OP__FLOW_DELETE = "gf:images:flow_delete"
)

Variables

This section is empty.

Functions

func DBcreatePolicy

func DBcreatePolicy(pPolicy *GFpolicy,
	pCtx context.Context,
	pRuntimeSys *gf_core.RuntimeSys) *gf_core.GFerror

func DBexistsByID

func DBexistsByID(pPolicyIDstr gf_core.GF_ID,
	pCtx context.Context,
	pRuntimeSys *gf_core.RuntimeSys) (bool, *gf_core.GFerror)

func DBsqlCreatePolicy

func DBsqlCreatePolicy(pPolicy *GFpolicy,
	pCtx context.Context,
	pRuntimeSys *gf_core.RuntimeSys) *gf_core.GFerror

func DBsqlCreateTables

func DBsqlCreateTables(pRuntimeSys *gf_core.RuntimeSys) *gf_core.GFerror

func DBsqlExistsByID

func DBsqlExistsByID(pPolicyID gf_core.GF_ID,
	pCtx context.Context,
	pRuntimeSys *gf_core.RuntimeSys) (bool, *gf_core.GFerror)

func DBsqlUpdatePolicy

func DBsqlUpdatePolicy(pPolicyID gf_core.GF_ID,
	pUpdateOp *GFpolicyUpdateOp,
	pCtx context.Context,
	pRuntimeSys *gf_core.RuntimeSys) *gf_core.GFerror

func DBupdatePolicy

func DBupdatePolicy(pPolicyIDstr gf_core.GF_ID,
	pUpdateOp *GFpolicyUpdateOp,
	pCtx context.Context,
	pRuntimeSys *gf_core.RuntimeSys) *gf_core.GFerror

func Tinit

func Tinit(pServiceNameStr string,
	pCliArgsMap map[string]interface{}) *gf_core.RuntimeSys

func Verify

func Verify(pRequestedOpStr string,
	pTargetResourceID gf_core.GF_ID,
	pUserID gf_core.GF_ID,
	pCtx context.Context,
	pRuntimeSys *gf_core.RuntimeSys) *gf_core.GFerror

Types

type GFpolicy

type GFpolicy struct {
	Id                primitive.ObjectID `bson:"_id,omitempty"`
	ID                gf_core.GF_ID      `bson:"id_str"`
	DeletedBool       bool               `bson:"deleted_bool"`
	CreationUNIXtimeF float64            `bson:"creation_unix_time_f"`

	// policy can be asssociated with multiple resources
	TargetResourceIDsLst  []string      `bson:"target_resource_ids_lst"`
	TargetResourceTypeStr string        `bson:"target_resource_type_str"`
	OwnerUserID           gf_core.GF_ID `bson:"owner_user_id_str"`

	// if the flow is fully public and all users (including anonymous) can view it
	PublicViewBool bool `bson:"public_view_bool"`

	// viewers are users that can view if PublicViewBool is false
	ViewersUserIDsLst []string `bson:"viewers_user_ids_lst"`

	// taggers are users that can attach tags/notes to flows
	TaggersUserIDsLst []string `bson:"taggers_user_ids_lst"`

	// editors are users that are allowed by the owner to update/add/remove items to the flow
	EditorsUserIDsLst []string `bson:"editors_user_ids_lst"`

	// admins have full control of the resource
	AdminsUserIDsLst []string
}

func DBgetPolicies

func DBgetPolicies(pTargetResourceIDstr gf_core.GF_ID,
	pCtx context.Context,
	pRuntimeSys *gf_core.RuntimeSys) ([]*GFpolicy, *gf_core.GFerror)

func DBgetPolicyByID

func DBgetPolicyByID(pPolicyIDstr gf_core.GF_ID,
	pCtx context.Context,
	pRuntimeSys *gf_core.RuntimeSys) (*GFpolicy, *gf_core.GFerror)

func DBsqlGetPolicies

func DBsqlGetPolicies(pTargetResourceID gf_core.GF_ID,
	pCtx context.Context,
	pRuntimeSys *gf_core.RuntimeSys) ([]*GFpolicy, *gf_core.GFerror)

func DBsqlGetPolicyByID

func DBsqlGetPolicyByID(pPolicyID gf_core.GF_ID,
	pCtx context.Context,
	pRuntimeSys *gf_core.RuntimeSys) (*GFpolicy, *gf_core.GFerror)

func PipelineCreate

func PipelineCreate(pTargetResourceID gf_core.GF_ID,
	pTargetResourceTypeStr string,
	pOwnerUserID gf_core.GF_ID,
	pCtx context.Context,
	pRuntimeSys *gf_core.RuntimeSys) (*GFpolicy, *gf_core.GFerror)

type GFpolicyUpdateOp

type GFpolicyUpdateOp struct {
	PublicViewBool *bool
}

type GFpolicyUpdateOutput

type GFpolicyUpdateOutput struct {
	PolicyExistsBool bool
}

func PipelineUpdate

func PipelineUpdate(pTargetResourceIDstr gf_core.GF_ID,
	pPolicyID gf_core.GF_ID,
	pOwnerUserID gf_core.GF_ID,
	pCtx context.Context,
	pRuntimeSys *gf_core.RuntimeSys) (*GFpolicyUpdateOutput, *gf_core.GFerror)

Jump to

Keyboard shortcuts

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