organization

package module
v0.0.0-...-ded6435 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2017 License: Apache-2.0 Imports: 14 Imported by: 2

README

organization

organization management tools.

Documentation

Index

Constants

View Source
const (
	// AuditActionAdd ...
	AuditActionAdd = `add`
	// AuditActionDel ....
	AuditActionDel = `delete`
	// AuditActionUpdate ....
	AuditActionUpdate = `update`
)
View Source
const (
	// AuditCategoryUnit ...
	AuditCategoryUnit = `department`
	// AuditCategoryMember ...
	AuditCategoryMember = `member`
)

Variables

View Source
var MemberMultipleACLAttrs = [...]string{`rbacRole`}

MemberMultipleACLAttrs default multiple acl attributes

View Source
var MemberMultipleAttrs = [...]string{`email`, `unitID`}

MemberMultipleAttrs default multiple attributes

View Source
var MemberSignleACLAttrs = [...]string{`rbacType`}

MemberSignleACLAttrs default signle acl attributes

View Source
var MemberSignleAttrs = [...]string{`id`, `name`, `cn`, `telephoneNumber`, `labeledURI`, `gender`, `title`, `priority`}

MemberSignleAttrs default signle attributes

View Source
var UnitAttributes = [...]string{`id`, `ou`, `description`, `priority`}

UnitAttributes ...

Functions

This section is empty.

Types

type AuditContent

type AuditContent []map[string]interface{}

AuditContent ...

type Organization

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

Organization ldap operation handler

func NewOrganizationWithSimpleBind

func NewOrganizationWithSimpleBind(subffix, host, rootDN, rootPWD string, port int, orgViewChangeEvent chan []string) (*Organization, error)

NewOrganizationWithSimpleBind ...

func (*Organization) Add

func (org *Organization) Add(addRequest *ldap.AddRequest) error

Add ...

func (*Organization) AddMember

func (org *Organization) AddMember(info map[string][]string) (string, error)

AddMember to ldap server

func (*Organization) AddPermission

func (org *Organization) AddPermission(name, description string, types []string, isUnit bool) (string, error)

AddPermission to ldap server

func (*Organization) AddRole

func (org *Organization) AddRole(name, description string, ups, pps []string) (string, error)

AddRole to ldap server, this method will automatically update org's rbacx

func (*Organization) AddType

func (org *Organization) AddType(name, description string, isUnit bool) (string, error)

AddType desgined to add a new dolresType

func (*Organization) AddUnit

func (org *Organization) AddUnit(parentID string, info map[string][]string) (string, error)

AddUnit to ldap

func (*Organization) AllRoles

func (org *Organization) AllRoles() ([]map[string]interface{}, error)

AllRoles ...

func (*Organization) AllUnit

func (org *Organization) AllUnit() ([]map[string]interface{}, error)

AllUnit ...

func (*Organization) AuthMember

func (org *Organization) AuthMember(telephoneNumber, pwd string) (string, error)

AuthMember ...

func (*Organization) Compare

func (org *Organization) Compare(dn, attribute, value string) (bool, error)

Compare ...

func (*Organization) Del

func (org *Organization) Del(delRequest *ldap.DelRequest) error

Del ...

func (*Organization) DelMember

func (org *Organization) DelMember(id string) error

DelMember by id

func (*Organization) DelPermission

func (org *Organization) DelPermission(id string) error

DelPermission in ldap

func (*Organization) DelRole

func (org *Organization) DelRole(id string) error

DelRole from ldap server, automatically update org's rbacx

func (*Organization) DelType

func (org *Organization) DelType(id string, isUnit bool) error

DelType by id

func (*Organization) DelUnit

func (org *Organization) DelUnit(id string) error

DelUnit ...

func (*Organization) GenerateChangeLogFromVersion

func (org *Organization) GenerateChangeLogFromVersion(version string, mid string) (string, []map[string]interface{}, error)

GenerateChangeLogFromVersion ...

func (*Organization) IsValidVersion

func (org *Organization) IsValidVersion(version string) bool

IsValidVersion ...

func (*Organization) LoadPolicy

func (org *Organization) LoadPolicy(model model.Model) error

LoadPolicy ...

func (*Organization) MemberByID

func (org *Organization) MemberByID(id string, containACL bool, containPwd bool) (map[string]interface{}, error)

MemberByID search member by id

func (*Organization) MemberByIDs

func (org *Organization) MemberByIDs(ids []string, containACL bool, containPwd bool) ([]map[string]interface{}, error)

MemberByIDs ...

func (*Organization) MemberIDsByDepartmentIDs

func (org *Organization) MemberIDsByDepartmentIDs(ids []string) ([]string, error)

MemberIDsByDepartmentIDs ...

func (*Organization) MemberIDsByRoleIDs

func (org *Organization) MemberIDsByRoleIDs(rids []string) ([]string, error)

MemberIDsByRoleIDs ...

func (*Organization) MemberIDsByTypeIDs

func (org *Organization) MemberIDsByTypeIDs(tids []string) ([]string, error)

MemberIDsByTypeIDs ...

func (*Organization) Members

func (org *Organization) Members(pageSize uint32, cookie []byte) (*SearchResult, error)

Members return all members

func (*Organization) Modify

func (org *Organization) Modify(modifyRequest *ldap.ModifyRequest) error

Modify ...

func (*Organization) ModifyMember

func (org *Organization) ModifyMember(id string, info map[string][]string) error

ModifyMember ...

func (*Organization) ModifyPassword

func (org *Organization) ModifyPassword(id, originalPassword, newPassword string) error

ModifyPassword ...

func (*Organization) ModifyPermission

func (org *Organization) ModifyPermission(id, name, description string, types []string) error

ModifyPermission in ldap

func (*Organization) ModifyRole

func (org *Organization) ModifyRole(id, name, description string, ups, pps []string) error

ModifyRole in ldap server, automatically update org's rbacx

func (*Organization) ModifyType

func (org *Organization) ModifyType(id string, name, description string, isUnit bool) error

ModifyType update name or description of doloresType

func (*Organization) ModifyUnit

func (org *Organization) ModifyUnit(id string, info map[string][]string) error

ModifyUnit ...

func (*Organization) OrganizationView

func (org *Organization) OrganizationView(id string) ([]map[string]interface{}, []map[string]interface{}, string, error)

OrganizationView get this member's visible departments 、members and version of this `organization view`

func (*Organization) PasswordModify

func (org *Organization) PasswordModify(passwordModifyRequest *ldap.PasswordModifyRequest) (*ldap.PasswordModifyResult, error)

PasswordModify ...

func (*Organization) PermissionByID

func (org *Organization) PermissionByID(id string) (map[string]interface{}, error)

PermissionByID in ldap

func (*Organization) PermissionByIDs

func (org *Organization) PermissionByIDs(ids []string) (*SearchResult, error)

PermissionByIDs in ldap

func (*Organization) PermissionByType

func (org *Organization) PermissionByType(dtype string, isUnit bool) ([]string, error)

PermissionByType all permission which contain this dolorestype

func (*Organization) Permissions

func (org *Organization) Permissions(isUnit bool, pageSize uint32, cookie []byte) (*SearchResult, error)

Permissions in ldap

func (*Organization) RoleByID

func (org *Organization) RoleByID(id string) (map[string]interface{}, error)

RoleByID ...

func (*Organization) RoleByIDs

func (org *Organization) RoleByIDs(ids []string) (*SearchResult, error)

RoleByIDs in ldap

func (*Organization) RoleIDsByMemberID

func (org *Organization) RoleIDsByMemberID(id string) ([]string, error)

RoleIDsByMemberID ...

func (*Organization) RoleIDsByPermissionID

func (org *Organization) RoleIDsByPermissionID(id string) ([]string, error)

RoleIDsByPermissionID which role contain this permission

func (*Organization) Roles

func (org *Organization) Roles(pageSize uint32, cookie []byte) (*SearchResult, error)

Roles in ldap

func (*Organization) SavePolicy

func (org *Organization) SavePolicy(model model.Model) error

SavePolicy ...

func (*Organization) Search

func (org *Organization) Search(searchRequest *ldap.SearchRequest) (*ldap.SearchResult, error)

Search ...

func (*Organization) SearchWithPaging

func (org *Organization) SearchWithPaging(searchRequest *ldap.SearchRequest, pagingSize uint32) (*ldap.SearchResult, error)

SearchWithPaging ...

func (*Organization) TypeByID

func (org *Organization) TypeByID(id string) (map[string]interface{}, error)

TypeByID ...

func (*Organization) TypeByIDs

func (org *Organization) TypeByIDs(ids []string) ([]map[string]interface{}, error)

TypeByIDs ...

func (*Organization) TypeByPermissionID

func (org *Organization) TypeByPermissionID(id string) ([]map[string]interface{}, error)

TypeByPermissionID ...

func (*Organization) Types

func (org *Organization) Types(isUnit bool, pageSize uint32, cookie []byte) (*SearchResult, error)

Types in ldap server

func (*Organization) UnitByID

func (org *Organization) UnitByID(id string) (map[string]interface{}, error)

UnitByID ...

func (*Organization) UnitByIDs

func (org *Organization) UnitByIDs(ids []string) ([]map[string]interface{}, error)

UnitByIDs ...

func (*Organization) UnitIDsByTypeIDs

func (org *Organization) UnitIDsByTypeIDs(ids []string) ([]string, error)

UnitIDsByTypeIDs ...

func (*Organization) UnitSubIDs

func (org *Organization) UnitSubIDs(id string) ([]string, error)

UnitSubIDs ....

type SearchResult

type SearchResult struct {
	Size   uint32
	Cookie []byte
	Data   []map[string]interface{}
}

SearchResult ...

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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