uas

package
v0.15.108 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddOrgPermissionsToRoles

func AddOrgPermissionsToRoles(req *AddOrgPermissionsToRolesRequest) error

func AddOrgRoleToUsers

func AddOrgRoleToUsers(req *AddOrgRoleToUsersRequest) error

func AddRolesToUser

func AddRolesToUser(namespace string, orgID string, userID string, roleID ...string) error

func AddUsersToCurrentOrganizationWithRoles

func AddUsersToCurrentOrganizationWithRoles(req *AddUsersToCurrentOrganizationWithRolesRequest) error

func AddUsersToOrg

func AddUsersToOrg(namespace string, orgID string, userIDs ...string) error

func ClearOrgPermissionsFromRoles

func ClearOrgPermissionsFromRoles(req *ClearOrgPermissionsFromRolesRequest) error

func ClearOrgUsers

func ClearOrgUsers(namespace string, orgID string) error

func ClearRolePerm

func ClearRolePerm(namespace string, orgID string, roleID string) error

func ClearUserRole

func ClearUserRole(namespace string, orgID string, userID string) error

func ConvenientCreateOrg

func ConvenientCreateOrg(req *CreateOrganizationConvenientRequest) error

func ConvenientCreatePerm

func ConvenientCreatePerm(req *CreatePermissionConvenientRequest) error

func ConvenientCreateRole

func ConvenientCreateRole(req *CreateRoleConvenientRequest) error

func ConvenientCreateUser

func ConvenientCreateUser(req *CreateUserConvenientRequest) (string, error)

func CreateOrg

func CreateOrg(name string) (string, error)

func CreateOrgRolesAndPermissionsConvenient

func CreateOrgRolesAndPermissionsConvenient(req *CreateOrgRolesAndPermissionsConvenientRequest) (string, error)

func CreatePerm

func CreatePerm(namespace string, action string, desc string, resource string) error

func CreatePermissions

func CreatePermissions(req *CreatePermissionsRequest) ([]string, error)

func CreateRole

func CreateRole(namespace string, name string) error

func CreateRolesAndPermissionsConvenient

func CreateRolesAndPermissionsConvenient(req *CreateRolesAndPermissionsConvenientRequest) error

func CreateUser

func CreateUser(userName string, password string, expiredTime string) (string, error)

func CreateUserAndAddRoles

func CreateUserAndAddRoles(req *CreateUserAndAddRolesRequest) (string, error)

func DeleteNamespaceOrg

func DeleteNamespaceOrg(namespace string, id string) error

func DeleteNamespaceUser

func DeleteNamespaceUser(namespace string, userID string) error

func DeleteOrg

func DeleteOrg(id string) error

func DeleteOrgRoleFromUsers

func DeleteOrgRoleFromUsers(req *DeleteOrgRoleFromUsersQuery) error

func DeleteOrgUsers

func DeleteOrgUsers(namespace string, orgID string, userIDs ...string) error

func DeletePerm

func DeletePerm(namespace string, permID ...string) error

func DeletePermissions

func DeletePermissions(req *DeletePermissionsQuery) error

func DeleteRole

func DeleteRole(namespace string, roleID string) error

func DeleteRolePerm

func DeleteRolePerm(namespace string, orgID string, roleID string, permID ...string) error

func DeleteRoles

func DeleteRoles(namespace string, ids string) error

func DeleteUser

func DeleteUser(userID string) error

func DeleteUserRole

func DeleteUserRole(namespace string, orgID string, userID string, roleID ...string) error

func DeleteUserThorough added in v0.15.19

func DeleteUserThorough(userId string) error

func Destroy

func Destroy()

func GetToken

func GetToken(userName string, pwd string, expireSec int64) (string, error)

func Init

func Init(baseUrl string, timeoutSec time.Duration)

func RoleAddPerm

func RoleAddPerm(namespace string, orgID string, roleID string, permID ...string) error

func SetUserOrg

func SetUserOrg(namespace string, userID string, orgID string) error

func UpdateOrg

func UpdateOrg(id string, name string) error

func UpdatePerm

func UpdatePerm(namespace string, id string, desc string, action string, resource string) error

func UpdateRole

func UpdateRole(namespace string, id string, name string) error

func UpdateRolePerms

func UpdateRolePerms(namespace string, orgID string, roleID string, permID ...string) error

func UpdateUser

func UpdateUser(id string, userName string, password string, expiredTime string) error

func UpdateUserRole

func UpdateUserRole(namespace string, orgID string, userID string, roleID ...string) error

Types

type APIKeyInfo

type APIKeyInfo struct {
	AccessKey string `json:"accessKey" binding:"required"`
	Describe  string `json:"describe"`
}

type AddOrgPermissionsToRoleRequest

type AddOrgPermissionsToRoleRequest struct {
	Namespace     string `json:"namespace" binding:"required"`
	OrgID         string `json:"orgId" binding:"required"`
	RoleID        string `json:"roleId" binding:"required"`
	PermissionIDs string `json:"permissionIds" binding:"required"`
}

type AddOrgPermissionsToRolesRequest

type AddOrgPermissionsToRolesRequest struct {
	Namespace               string                          `json:"namespace" binding:"required"`
	OrgID                   string                          `json:"orgId" binding:"required"`
	RoleIDsAndPermissionIDs []RoleIDAndPermissionIDsRequest `json:"roleIDsAndPermissionIDs" binding:"required"`
}

type AddOrgPermissionsToRolesResponse

type AddOrgPermissionsToRolesResponse struct {
	// contains filtered or unexported fields
}

type AddOrgRoleToUsersRequest

type AddOrgRoleToUsersRequest struct {
	Namespace string `json:"namespace" binding:"required"`
	OrgID     string `json:"orgId" binding:"required"`
	UserIDs   string `json:"userIds" binding:"required"`
	RoleID    string `json:"roleId" binding:"required"`
}

type AddOrgRolesToUserRequest

type AddOrgRolesToUserRequest struct {
	Namespace string `json:"namespace" binding:"required"`
	OrgID     string `json:"orgId" binding:"required"`
	UserID    string `json:"userId" binding:"required"`
	RoleIDs   string `json:"roleIds" binding:"required"`
}

type AddUsersToCurrentOrganizationWithRolesRequest

type AddUsersToCurrentOrganizationWithRolesRequest struct {
	AddUsersToOrganizationRequest
	RoleIDs string `json:"roleIds" binding:"required"`
}

type AddUsersToCurrentOrganizationWithRolesResponse

type AddUsersToCurrentOrganizationWithRolesResponse struct {
	// contains filtered or unexported fields
}

type AddUsersToOrganizationRequest

type AddUsersToOrganizationRequest struct {
	Namespace string `json:"namespace" binding:"required"`
	OrgID     string `json:"orgId" binding:"required"`
	UserIDs   string `json:"userIds" binding:"required"`
}

type CheckAPIKeyRequest

type CheckAPIKeyRequest struct {
	Namespace string `json:"namespace" binding:"required"`
	APIToken  string `json:"apiToken" binding:"required"`
}

type CheckAPIKeyResponse

type CheckAPIKeyResponse struct {
	OrgInfo  OrganizationInfo  `json:"orgInfo" binding:"required"`
	UserInfo UserInfoWithRoles `json:"userInfo" binding:"required"`
	// contains filtered or unexported fields
}

type CheckAccessTokenRequest

type CheckAccessTokenRequest struct {
	Namespace   string `json:"namespace" binding:"required"`
	AccessToken string `json:"accessToken" binding:"required"`
	Resource    string `json:"resource" binding:"required"`
	Action      string `json:"action" binding:"required"`
}

type CheckAccessTokenResponse

type CheckAccessTokenResponse struct {
	UserInfo *UserInfoWithRoles `json:"userInfo"`
	// contains filtered or unexported fields
}

type ClearOrgPermissionsFromRoleRequest

type ClearOrgPermissionsFromRoleRequest struct {
	Namespace string `form:"namespace" binding:"required"`
	OrgID     string `form:"orgId" binding:"required"`
	RoleID    string `form:"roleId" binding:"required"`
}

type ClearOrgPermissionsFromRolesRequest

type ClearOrgPermissionsFromRolesRequest struct {
	Namespace string `json:"namespace" binding:"required"`
	OrgID     string `json:"orgId" binding:"required"`
	RoleIDs   string `json:"roleIds" binding:"required"`
}

type ClearOrgPermissionsFromRolesResponse

type ClearOrgPermissionsFromRolesResponse struct {
	// contains filtered or unexported fields
}

type ClearOrgRolesFromUserRequest

type ClearOrgRolesFromUserRequest struct {
	Namespace string `form:"namespace" binding:"required"`
	OrgID     string `form:"orgId" binding:"required"`
	UserID    string `form:"userId" binding:"required"`
}

type ClearUsersFromOrganizationQuery

type ClearUsersFromOrganizationQuery struct {
	Namespace string `form:"namespace" binding:"required"`
	OrgID     string `form:"orgId" binding:"required"`
}

type CreateAPIKeyRequest

type CreateAPIKeyRequest struct {
	Namespace string `json:"namespace" binding:"required"`
	OrgID     string `json:"orgId" binding:"required"`
	UserID    string `json:"userId" binding:"required"`
	Describe  string `json:"describe"`
}

type CreateAPIKeyResponse

type CreateAPIKeyResponse struct {
	AccessKey string `json:"accessKey" binding:"required"`
	SecretKey string `json:"secretKey" binding:"required"`
	Describe  string `json:"describe"`
	// contains filtered or unexported fields
}

type CreateOrgRolesAndPermissionsConvenientRequest

type CreateOrgRolesAndPermissionsConvenientRequest struct {
	CreateOrganizationRequest
	Namespace                 string                                   `json:"namespace" binding:"required"`
	CreateRolesAndPermissions []CreateRolePermissionsConvenientRequest `json:"createRolesAndPermissions" binding:"required"`
}

type CreateOrgRolesAndPermissionsConvenientResponse

type CreateOrgRolesAndPermissionsConvenientResponse struct {
	ID string `json:"id"`
	// contains filtered or unexported fields
}

type CreateOrganizationConvenientRequest

type CreateOrganizationConvenientRequest struct {
	CreateOrganizationRequest
	Namespace                 string                                   `json:"namespace" binding:"required"`
	CreateUsers               []CreateUserRequest                      `json:"createUsers" binding:"required"`
	CreateRolesAndPermissions []CreateRolePermissionsConvenientRequest `json:"createRolesAndPermissions" binding:"required"`
}

type CreateOrganizationRequest

type CreateOrganizationRequest struct {
	Name string `json:"name" binding:"required"`
}

type CreateOrganizationResponse

type CreateOrganizationResponse struct {
	ID string `json:"id"`
	// contains filtered or unexported fields
}

type CreatePermissionConvenientRequest

type CreatePermissionConvenientRequest struct {
	CreatePermissionRequest
	AddToOrgID   string   `json:"addToOrgId" binding:"required"`
	AddToRoleIDs []string `json:"addToRoleIds" binding:"required"`
}

type CreatePermissionRequest

type CreatePermissionRequest struct {
	Namespace string `json:"namespace" binding:"required"`
	CreatePermissionRequestNoNamespace
}

type CreatePermissionRequestNoNamespace

type CreatePermissionRequestNoNamespace struct {
	Describe string `json:"describe"`
	Resource string `json:"resource" binding:"required"`
	Action   string `json:"action" binding:"required"`
}

type CreatePermissionsRequest

type CreatePermissionsRequest struct {
	Namespace   string                               `json:"namespace" binding:"required"`
	Permissions []CreatePermissionRequestNoNamespace `json:"permissions" binding:"required"`
}

type CreatePermissionsResponse

type CreatePermissionsResponse struct {
	IDs []string `json:"ids"`
	// contains filtered or unexported fields
}

type CreateRoleConvenientRequest

type CreateRoleConvenientRequest struct {
	CreateRoleRequest
	Permissions  []CreatePermissionRequestNoNamespace `json:"permissions" binding:"required"`
	AddToOrgID   string                               `json:"addToOrgId" binding:"required"`
	AddToUserIDs []string                             `json:"addToUserIds" binding:"required"`
}

type CreateRolePermissionsConvenientRequest

type CreateRolePermissionsConvenientRequest struct {
	CreateRoleRequestNoNamespace
	Permissions []CreatePermissionRequestNoNamespace `json:"permissions" binding:"required"`
}

type CreateRoleRequest

type CreateRoleRequest struct {
	Namespace string `json:"namespace" binding:"required"`
	CreateRoleRequestNoNamespace
}

type CreateRoleRequestNoNamespace

type CreateRoleRequestNoNamespace struct {
	Name string `json:"name" binding:"required"`
}

type CreateRolesAndPermissionsConvenientRequest

type CreateRolesAndPermissionsConvenientRequest struct {
	Namespace                 string                                   `json:"namespace" binding:"required"`
	AddToOrgID                string                                   `json:"addToOrgId" binding:"required"`
	CreateRolesAndPermissions []CreateRolePermissionsConvenientRequest `json:"createRolesAndPermissions" binding:"required"`
}

type CreateRolesAndPermissionsConvenientResponse

type CreateRolesAndPermissionsConvenientResponse struct {
	// contains filtered or unexported fields
}

type CreateRolesAndPermissionsNoRelationConvenientRequest

type CreateRolesAndPermissionsNoRelationConvenientRequest struct {
	Namespace   string                               `json:"namespace" binding:"required"`
	Roles       []CreateRoleRequestNoNamespace       `json:"roles" binding:"required"`
	Permissions []CreatePermissionRequestNoNamespace `json:"permissions" binding:"required"`
}

type CreateRolesAndPermissionsNoRelationConvenientResponse

type CreateRolesAndPermissionsNoRelationConvenientResponse struct {
	RoleIDs       []string `json:"roleIds"`
	PermissionIDs []string `json:"permissionIds"`
	// contains filtered or unexported fields
}

type CreateUserAndAddRolesRequest

type CreateUserAndAddRolesRequest struct {
	CreateUserRequest
	Namespace string `json:"namespace" binding:"required"`
	OrgID     string `json:"firstOrgId" binding:"required"`
	RoleIDs   string `json:"roleIds" binding:"required"`
}

type CreateUserAndAddRolesResponse

type CreateUserAndAddRolesResponse struct {
	ID string `json:"id"`
	// contains filtered or unexported fields
}

type CreateUserConvenientRequest

type CreateUserConvenientRequest struct {
	CreateUserRequest
	Namespace                 string                                   `json:"namespace" binding:"required"`
	FirstOrgID                string                                   `json:"firstOrgId" binding:"required"`
	CreateRolesAndPermissions []CreateRolePermissionsConvenientRequest `json:"createRolesAndPermissions" binding:"required"`
}

type CreateUserConvenientResponse

type CreateUserConvenientResponse struct {
	ID string `json:"id"`
	// contains filtered or unexported fields
}

type CreateUserRequest

type CreateUserRequest struct {
	UserName    string `json:"userName" binding:"required"`
	Password    string `json:"password" binding:"required"`
	ExpiredTime string `json:"expiredTime" binding:"required"`
}

type CreateUserResponse added in v0.3.0

type CreateUserResponse struct {
	ID string `json:"id"`
	// contains filtered or unexported fields
}

type DeleteAPIKeyQuery

type DeleteAPIKeyQuery struct {
	Namespace string `form:"namespace" binding:"required"`
	OrgID     string `form:"orgId" binding:"required"`
	UserID    string `form:"userId" binding:"required"`
}

type DeleteOrgPermissionsFromRoleQuery

type DeleteOrgPermissionsFromRoleQuery struct {
	Namespace     string `form:"namespace" binding:"required"`
	OrgID         string `form:"orgId" binding:"required"`
	RoleID        string `form:"roleId" binding:"required"`
	PermissionIDs string `form:"permissionIds" binding:"required"`
}

type DeleteOrgRoleFromUsersQuery

type DeleteOrgRoleFromUsersQuery struct {
	Namespace string `form:"namespace" binding:"required"`
	OrgID     string `form:"orgId" binding:"required"`
	UserIDs   string `form:"userIds" binding:"required"`
	RoleID    string `form:"roleId" binding:"required"`
}

type DeleteOrgRolesFromUserQuery

type DeleteOrgRolesFromUserQuery struct {
	Namespace string `form:"namespace" binding:"required"`
	OrgID     string `form:"orgId" binding:"required"`
	UserID    string `form:"userId" binding:"required"`
	RoleIDs   string `form:"roleIds" binding:"required"`
}

type DeleteOrganizationInNamespaceQuery

type DeleteOrganizationInNamespaceQuery struct {
	Namespace string `form:"namespace" binding:"required"`
	ID        string `form:"id" binding:"required"`
}

type DeletePermissionQuery

type DeletePermissionQuery struct {
	Namespace string `form:"namespace" binding:"required"`
}

type DeletePermissionsQuery

type DeletePermissionsQuery struct {
	Namespace string `form:"namespace" binding:"required"`
	IDs       string `form:"ids" binding:"required"`
}

type DeleteRoleQuery

type DeleteRoleQuery struct {
	Namespace string `form:"namespace" binding:"required"`
}

type DeleteUserInNamespaceQuery

type DeleteUserInNamespaceQuery struct {
	Namespace string `form:"namespace" binding:"required"`
	ID        string `form:"id" binding:"required"`
}

type DeleteUserThoroughRequest added in v0.15.19

type DeleteUserThoroughRequest struct {
	UserId string `json:"userId" binding:"required"`
}

type DeleteUsersFromOrganizationQuery

type DeleteUsersFromOrganizationQuery struct {
	Namespace string `form:"namespace" binding:"required"`
	OrgID     string `form:"orgId" binding:"required"`
	UserIDs   string `form:"userIds" binding:"required"`
}

type GetAPIKeysQuery

type GetAPIKeysQuery struct {
	Namespace string `form:"namespace" binding:"required"`
	OrgID     string `form:"orgId"`
	UserID    string `form:"userId"`
}

type GetAPIKeysResponse

type GetAPIKeysResponse struct {
	Infos []APIKeyInfo `json:"infos" binding:"required"`
	// contains filtered or unexported fields
}

type GetAccessTokenRequest

type GetAccessTokenRequest struct {
	UserName  string `json:"userName" binding:"required"`
	Password  string `json:"password" binding:"required"`
	ExpireSec int64  `json:"expireSec"`
}

type GetAccessTokenResponse

type GetAccessTokenResponse struct {
	AccessToken string `json:"accessToken"`
	// contains filtered or unexported fields
}

type GetOrgPermissionsWithRolesQuery

type GetOrgPermissionsWithRolesQuery struct {
	OrgID string `form:"orgId" binding:"required"`
	GetPermissionsQuery
}

type GetOrgPermissionsWithRolesResponse

type GetOrgPermissionsWithRolesResponse struct {
	PageNo     int                       `json:"pageNo"`
	TotalCount int64                     `json:"totalCount"`
	Infos      []PermissionInfoWithRoles `json:"infos"`
	// contains filtered or unexported fields
}

type GetOrgRolesWithPermissionsQuery

type GetOrgRolesWithPermissionsQuery struct {
	OrgID string `form:"orgId" binding:"required"`
	GetRolesQuery
}

type GetOrgRolesWithPermissionsResponse

type GetOrgRolesWithPermissionsResponse struct {
	PageNo     int                       `json:"pageNo"`
	TotalCount int64                     `json:"totalCount"`
	Infos      []RoleInfoWithPermissions `json:"infos"`
	// contains filtered or unexported fields
}

type GetOrgRolesWithUsersQuery

type GetOrgRolesWithUsersQuery struct {
	OrgID string `form:"orgId" binding:"required"`
	GetRolesQuery
}

type GetOrgRolesWithUsersResponse

type GetOrgRolesWithUsersResponse struct {
	PageNo     int                 `json:"pageNo"`
	TotalCount int64               `json:"totalCount"`
	Infos      []RoleInfoWithUsers `json:"infos"`
	// contains filtered or unexported fields
}

type GetOrgUsersWithRolesQuery

type GetOrgUsersWithRolesQuery struct {
	Namespace string `form:"namespace" binding:"required"`
	OrgID     string `form:"orgId" binding:"required"`
	GetUsersQuery
}

type GetOrgUsersWithRolesResponse

type GetOrgUsersWithRolesResponse struct {
	PageNo     int                 `json:"pageNo"`
	TotalCount int64               `json:"totalCount"`
	Infos      []UserInfoWithRoles `json:"infos"`
	// contains filtered or unexported fields
}

type GetOrganizationsQuery

type GetOrganizationsQuery struct {
	ID       string `form:"id"`
	Name     string `form:"name"`
	PageNo   int    `form:"pageNo"`
	PageSize int    `form:"pageSize"`
}

type GetOrganizationsResponse

type GetOrganizationsResponse struct {
	PageNo     int                `json:"pageNo"`
	TotalCount int64              `json:"totalCount"`
	Infos      []OrganizationInfo `json:"infos"`
	// contains filtered or unexported fields
}

type GetOrganizationsWithUsersQuery

type GetOrganizationsWithUsersQuery struct {
	Namespace string `form:"namespace" binding:"required"`
	GetOrganizationsQuery
}

type GetOrganizationsWithUsersResponse

type GetOrganizationsWithUsersResponse struct {
	PageNo     int                         `json:"pageNo"`
	TotalCount int64                       `json:"totalCount"`
	Infos      []OrganizationInfoWithUsers `json:"infos"`
	// contains filtered or unexported fields
}

type GetPermissionsByResourcesAndActionsRequest

type GetPermissionsByResourcesAndActionsRequest struct {
	Namespace           string                     `json:"namespace" binding:"required"`
	ResourcesAndActions []ResourceAndActionRequest `json:"resourcesAndActions" binding:"required"`
}

type GetPermissionsByResourcesAndActionsResponse

type GetPermissionsByResourcesAndActionsResponse struct {
	Infos []PermissionInfo `json:"infos"`
	// contains filtered or unexported fields
}

type GetPermissionsQuery

type GetPermissionsQuery struct {
	Namespace string `form:"namespace" binding:"required"`
	ID        string `form:"id"`
	Resource  string `form:"resource"`
	Action    string `form:"action"`
	PageNo    int    `form:"pageNo"`
	PageSize  int    `form:"pageSize"`
}

type GetPermissionsResponse

type GetPermissionsResponse struct {
	PageNo     int              `json:"pageNo"`
	TotalCount int64            `json:"totalCount"`
	Infos      []PermissionInfo `json:"infos"`
	// contains filtered or unexported fields
}

type GetRolesQuery

type GetRolesQuery struct {
	Namespace string `form:"namespace" binding:"required"`
	ID        string `form:"id"`
	Name      string `form:"name"`
	PageNo    int    `form:"pageNo"`
	PageSize  int    `form:"pageSize"`
}

type GetRolesResponse

type GetRolesResponse struct {
	PageNo     int        `json:"pageNo"`
	TotalCount int64      `json:"totalCount"`
	Infos      []RoleInfo `json:"infos"`
	// contains filtered or unexported fields
}

type GetUserCurrentOrganizationQuery

type GetUserCurrentOrganizationQuery struct {
	Namespace string `form:"namespace" binding:"required"`
	UserID    string `form:"userId" binding:"required"`
}

type GetUserCurrentOrganizationResponse

type GetUserCurrentOrganizationResponse struct {
	OrgInfo *OrganizationInfo
	// contains filtered or unexported fields
}

type GetUsersInOrganizationQuery

type GetUsersInOrganizationQuery struct {
	OrgID    string `form:"orgId" binding:"required"`
	UserID   string `form:"userId"`
	UserName string `form:"userName"`
	PageNo   int    `form:"pageNo"`
	PageSize int    `form:"pageSize"`
}

type GetUsersInOrganizationResponse

type GetUsersInOrganizationResponse struct {
	PageNo     int        `json:"pageNo"`
	TotalCount int64      `json:"totalCount"`
	Infos      []UserInfo `json:"infos"`
	// contains filtered or unexported fields
}

type GetUsersQuery

type GetUsersQuery struct {
	ID       string `form:"id"`
	UserName string `form:"userName"`
	PageNo   int    `form:"pageNo"`
	PageSize int    `form:"pageSize"`
}

type GetUsersResponse

type GetUsersResponse struct {
	PageNo     int        `json:"pageNo"`
	TotalCount int64      `json:"totalCount"`
	Infos      []UserInfo `json:"infos"`
	// contains filtered or unexported fields
}

type GetUsersWithOrganizationsQuery

type GetUsersWithOrganizationsQuery struct {
	Namespace string `form:"namespace" binding:"required"`
	GetUsersQuery
}

type GetUsersWithOrganizationsResponse

type GetUsersWithOrganizationsResponse struct {
	PageNo     int                         `json:"pageNo"`
	TotalCount int64                       `json:"totalCount"`
	Infos      []UserInfoWithOrganizations `json:"infos"`
	// contains filtered or unexported fields
}

type OrganizationInfo

type OrganizationInfo struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

func GetOrg

func GetOrg(id string, name string, pageNo int, pageSize int) ([]OrganizationInfo, int64, error)

func GetOrgByID

func GetOrgByID(id string) (*OrganizationInfo, error)

func GetUserCurOrg

func GetUserCurOrg(namespace string, userID string) (*OrganizationInfo, error)

type OrganizationInfoWithUsers

type OrganizationInfoWithUsers struct {
	ID        string     `json:"id"`
	Name      string     `json:"name"`
	UserInfos []UserInfo `json:"userInfos"`
}

func GetOrgWithUsers

func GetOrgWithUsers(namespace string, id string, name string, pageNo int, pageSize int) ([]OrganizationInfoWithUsers, int64, error)

type PermissionInfo

type PermissionInfo struct {
	ID       string `json:"id"`
	Resource string `json:"resource"`
	Action   string `json:"action"`
	Describe string `json:"describe"`
}

func GetPerm

func GetPerm(namespace string, id string, resource string, action string, pageNo int, pageSize int) ([]PermissionInfo, int64, error)

type PermissionInfoWithRoles

type PermissionInfoWithRoles struct {
	ID        string            `json:"id"`
	Resource  string            `json:"resource"`
	Action    string            `json:"action"`
	Describe  string            `json:"describe"`
	OrgInfo   *OrganizationInfo `json:"orgInfo"`
	RoleInfos []RoleInfo        `json:"roleInfos"`
}

func GetPermRoles

func GetPermRoles(namespace string, orgID string, id string, name string, resource string,
	action string, pageNo int, pageSize int) ([]PermissionInfoWithRoles, int64, error)

type ResourceAndActionRequest

type ResourceAndActionRequest struct {
	Resource string `json:"resource" binding:"required"`
	Action   string `json:"action" binding:"required"`
}

type RoleIDAndPermissionIDsRequest

type RoleIDAndPermissionIDsRequest struct {
	RoleID        string   `json:"roleId" binding:"required"`
	PermissionIDs []string `json:"permissionIds" binding:"required"`
}

type RoleInfo

type RoleInfo struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

func GetRole

func GetRole(namespace string, id string, name string, pageNo int, pageSize int) ([]RoleInfo, int64, error)

func GetRolesByNames

func GetRolesByNames(namespace string, names string) ([]RoleInfo, error)

func GetUserRoles

func GetUserRoles(namespace string, orgID string, userID string) ([]RoleInfo, error)

type RoleInfoWithPermissions

type RoleInfoWithPermissions struct {
	ID              string            `json:"id"`
	Name            string            `json:"name"`
	OrgInfo         *OrganizationInfo `json:"orgInfo"`
	PermissionInfos []PermissionInfo  `json:"permissionInfos"`
}

func GetRoleInOrg

func GetRoleInOrg(namespace string, orgID string, id string, name string,
	pageNo int, pageSize int) ([]RoleInfoWithPermissions, int64, error)

type RoleInfoWithUsers

type RoleInfoWithUsers struct {
	ID        string            `json:"id"`
	Name      string            `json:"name"`
	OrgInfo   *OrganizationInfo `json:"orgInfo"`
	UserInfos []UserInfo        `json:"userInfos"`
}

func GetBoundRoleUsers

func GetBoundRoleUsers(namespace string, orgID string, id string, name string, pageNo int, pageSize int) ([]RoleInfoWithUsers, int64, error)

type SetUserCurrentOrganizationRequest

type SetUserCurrentOrganizationRequest struct {
	Namespace    string `json:"namespace" binding:"required"`
	UserID       string `json:"userId" binding:"required"`
	CurrentOrgID string `json:"currentOrgId" binding:"required"`
}

type UpdateOrgPermissionsOfRoleRequest

type UpdateOrgPermissionsOfRoleRequest struct {
	Namespace        string `json:"namespace" binding:"required"`
	OrgID            string `json:"orgId" binding:"required"`
	RoleID           string `json:"roleId" binding:"required"`
	NewPermissionIDs string `json:"newPermissionIds" binding:"required"`
}

type UpdateOrgRolesOfUserRequest

type UpdateOrgRolesOfUserRequest struct {
	Namespace  string `json:"namespace" binding:"required"`
	OrgID      string `json:"orgId" binding:"required"`
	UserID     string `json:"userId" binding:"required"`
	NewRoleIDs string `json:"newRoleIds" binding:"required"`
}

type UpdateOrganizationRequest

type UpdateOrganizationRequest struct {
	ID   string `json:"id" binding:"required"`
	Name string `json:"name"`
}

type UpdatePermissionRequest

type UpdatePermissionRequest struct {
	Namespace string `json:"namespace" binding:"required"`
	ID        string `json:"id" binding:"required"`
	Resource  string `json:"resource"`
	Action    string `json:"action"`
	Describe  string `json:"describe"`
}

type UpdateRoleRequest

type UpdateRoleRequest struct {
	Namespace string `json:"namespace" binding:"required"`
	ID        string `json:"id" binding:"required"`
	Name      string `json:"name"`
}

type UpdateUserRequest

type UpdateUserRequest struct {
	ID          string `json:"id" binding:"required"`
	UserName    string `json:"userName"`
	Password    string `json:"password"`
	ExpiredTime string `json:"expiredTime"`
}

type UserInfo

type UserInfo struct {
	ID       string `json:"id"`
	UserName string `json:"userName"`
}

func GetUser

func GetUser(id string, userName string, pageNo int, pageSize int) ([]UserInfo, int64, error)

func GetUserByID

func GetUserByID(userID string) (*UserInfo, error)

func GetUsersInOrganization

func GetUsersInOrganization(namespace string, req *GetUsersInOrganizationQuery) ([]UserInfo, int64, error)

type UserInfoWithOrganizations

type UserInfoWithOrganizations struct {
	ID       string             `json:"id"`
	UserName string             `json:"userName"`
	OrgInfos []OrganizationInfo `json:"orgInfos"`
}

func GetUserJoinedOrg

func GetUserJoinedOrg(namespace string, id string, userName string, pageNo int, pageSize int) ([]UserInfoWithOrganizations, int64, error)

type UserInfoWithRoles

type UserInfoWithRoles struct {
	ID        string            `json:"id"`
	UserName  string            `json:"userName"`
	OrgInfo   *OrganizationInfo `json:"orgInfo"`
	RoleInfos []RoleInfo        `json:"roleInfos"`
}

func CheckToken

func CheckToken(namespace string, token string, action string, resource string) (*UserInfoWithRoles, error)

func GetUserOrgRoles

func GetUserOrgRoles(namespace string, orgID string, id string, userName string, pageNo int, pageSize int) ([]UserInfoWithRoles, int64, error)

Jump to

Keyboard shortcuts

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