You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
118 lines
3.7 KiB
118 lines
3.7 KiB
// ------------------------------------------------------------------------
|
|
// 🚀 Project Active8
|
|
// 🔗 UserStateActive Thing (activething.com) git.activething.com/go
|
|
//
|
|
// File name active.go
|
|
// ✍️ Created by DEV
|
|
// 📅 Modified 04/12/2024
|
|
//
|
|
// 🔒 Copyright 2024 activething.com
|
|
//
|
|
// 📜 LICENSE --------------------------------------------------------------
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
// ------------------------------------------------------------------------
|
|
|
|
package brbac
|
|
|
|
import "errs"
|
|
|
|
var (
|
|
|
|
// G Public vars
|
|
G = struct {
|
|
|
|
ErrInvalidActor errs.ErrCode
|
|
ErrInvalidIDRole errs.ErrCode
|
|
ErrRoleCycle errs.ErrCode
|
|
|
|
RoleProvider RoleProvider
|
|
|
|
|
|
} {
|
|
|
|
ErrInvalidActor : errs.ErrCode("invalid-actor-type"),
|
|
ErrInvalidIDRole: errs.ErrCode("invalid-id-role"),
|
|
ErrRoleCycle : errs.ErrCode("role-cycle"),
|
|
}
|
|
|
|
|
|
// g Private vars
|
|
g = struct {
|
|
actorFlags []ActorFlags
|
|
actorNames []string
|
|
}{
|
|
|
|
actorFlags: []ActorFlags{
|
|
ActorFlagVerified,
|
|
ActorFlagRequired,
|
|
ActorFlagRestricted,
|
|
ActorFlagLimited},
|
|
|
|
actorNames: []string{
|
|
"User", // 0x00
|
|
"Role", // 0x01
|
|
"Service", // 0x02
|
|
"Device", // 0x03
|
|
"Group", // 0x04
|
|
"Organization", // 0x05
|
|
"APIKey", // 0x06
|
|
"System", // 0x07
|
|
"Admin", // 0x08
|
|
"Visitor", // 0x09
|
|
"Auditor", // 0x0A
|
|
"ExternalClient", // 0x0B
|
|
"Provider", // 0x0C
|
|
"TemporaryToken", // 0x0D
|
|
"Bot", // 0x0E
|
|
"Reserved", // 0x0F
|
|
"BlockchainNode", // 0x10
|
|
"BlockchainUser", // 0x11
|
|
"SmartContract", // 0x12
|
|
"BlockchainAPI", // 0x13
|
|
"Wallet", // 0x14
|
|
"Miner", // 0x15
|
|
"Validator", // 0x16
|
|
"DApp", // 0x17
|
|
"Token", // 0x18
|
|
"BlockchainOracle", // 0x19
|
|
"BlockchainExplorer", // 0x1A
|
|
"DAO", // 0x1B
|
|
"NFT", // 0x1C
|
|
"BlockchainBridge", // 0x1D
|
|
"Staking", // 0x1E
|
|
"DefiPlatform", // 0x1F
|
|
"BlockchainWallet", // 0x20
|
|
"BlockchainExplorerAPI", // 0x21
|
|
"BlockchainTransaction", // 0x22
|
|
"BlockchainBackup", // 0x23
|
|
"SecurityModule", // 0x24
|
|
"QuantumComputer", // 0x25
|
|
"QuantumWallet", // 0x26
|
|
"AI", // 0x30
|
|
"CloudService", // 0x31
|
|
"Microservice", // 0x32
|
|
"ThirdParty", // 0x33
|
|
"ExternalSystem", // 0x34
|
|
"MobileDevice", // 0x35
|
|
"ExternalAPI", // 0x36
|
|
"Server", // 0x37
|
|
"UserAgent", // 0x38
|
|
"Container", // 0x39
|
|
"Network", // 0x3A
|
|
"EdgeDevice", // 0x3B
|
|
"VirtualMachine", // 0x3C
|
|
"Hypervisor", // 0x3D
|
|
},
|
|
}
|
|
)
|