Documentation
¶
Index ¶
Constants ¶
View Source
const ( MemberTypeObserver = "observer" MemberTypeOperator = "operator" MemberTypeAdministrator = "administrator" MemberTypeOwner = "owner" )
View Source
const ( DeviceAccept = iota DeviceReject DeviceRemove DeviceConnect DeviceRename DeviceDetails SessionPlay SessionClose SessionRemove SessionDetails FirewallCreate FirewallEdit FirewallRemove PublicKeyCreate PublicKeyEdit PublicKeyRemove NamespaceCreate NamespaceRename NamespaceAddMember NamespaceRemoveMember NamespaceEditMember NamespaceEnableSessionRecord NamespaceDelete BillingChooseDevices BillingAddPaymentMethod BillingUpdatePaymentMethod BillingRemovePaymentMethod BillingCancelSubscription BillingCreateSubscription BillingGetPaymentMethod BillingGetSubscription )
Variables ¶
View Source
var Actions = actions{ Device: deviceActions{ Accept: DeviceAccept, Reject: DeviceReject, Remove: DeviceRemove, Connect: DeviceConnect, Rename: DeviceRename, }, Session: sessionActions{ Play: SessionPlay, Close: SessionClose, Remove: SessionRemove, Details: SessionDetails, }, Firewall: firewallActions{ Create: FirewallCreate, Edit: FirewallEdit, Remove: FirewallRemove, }, PublicKey: publicKeyActions{ Create: PublicKeyCreate, Edit: PublicKeyEdit, Remove: PublicKeyRemove, }, Namespace: namespaceActions{ Create: NamespaceCreate, Rename: NamespaceRename, AddMember: NamespaceAddMember, RemoveMember: NamespaceRemoveMember, EditMember: NamespaceEditMember, EnableSessionRecord: NamespaceEnableSessionRecord, Delete: NamespaceDelete, }, Billing: billingActions{ ChooseDevices: BillingChooseDevices, AddPaymentMethod: BillingAddPaymentMethod, UpdatePaymentMethod: BillingUpdatePaymentMethod, RemovePaymentMethod: BillingRemovePaymentMethod, CancelSubscription: BillingCancelSubscription, CreateSubscription: BillingCreateSubscription, GetSubscription: BillingGetSubscription, }, }
Actions has all available and allowed actions. You should use it to get the code's action.
Functions ¶
func EvaluatePermission ¶
EvaluatePermission checks if the user's type has the permission to execute an action.
func EvaluateType ¶
EvaluateType checks if the first type has a great value than second.
func GetAllMemberTypes ¶
func GetAllMemberTypes() []string
GetAllMemberTypes return a list with all member types. What out, when you add a new type, you need to add it to this return list.
func GetTypeCode ¶
GetTypeCode converts a member's type to an int.
Types ¶
Click to show internal directories.
Click to hide internal directories.