import { InternalEnforcer } from './internalEnforcer'; import { MatchingFunction } from './model'; /** * ManagementEnforcer = InternalEnforcer + Management API. */ export declare class ManagementEnforcer extends InternalEnforcer { /** * getAllSubjects gets the list of subjects that show up in the current policy. * * @return all the subjects in "p" policy rules. It actually collects the * 0-index elements of "p" policy rules. So make sure your subject * is the 0-index element, like (sub, obj, act). Duplicates are removed. */ getAllSubjects(): Promise; /** * getAllNamedSubjects gets the list of subjects that show up in the currentnamed policy. * * @param ptype the policy type, can be "p", "p2", "p3", .. * @return all the subjects in policy rules of the ptype type. It actually * collects the 0-index elements of the policy rules. So make sure * your subject is the 0-index element, like (sub, obj, act). * Duplicates are removed. */ getAllNamedSubjects(ptype: string): Promise; /** * getAllObjects gets the list of objects that show up in the current policy. * * @return all the objects in "p" policy rules. It actually collects the * 1-index elements of "p" policy rules. So make sure your object * is the 1-index element, like (sub, obj, act). * Duplicates are removed. */ getAllObjects(): Promise; /** * getAllNamedObjects gets the list of objects that show up in the current named policy. * * @param ptype the policy type, can be "p", "p2", "p3", .. * @return all the objects in policy rules of the ptype type. It actually * collects the 1-index elements of the policy rules. So make sure * your object is the 1-index element, like (sub, obj, act). * Duplicates are removed. */ getAllNamedObjects(ptype: string): Promise; /** * getAllActions gets the list of actions that show up in the current policy. * * @return all the actions in "p" policy rules. It actually collects * the 2-index elements of "p" policy rules. So make sure your action * is the 2-index element, like (sub, obj, act). * Duplicates are removed. */ getAllActions(): Promise; /** * GetAllNamedActions gets the list of actions that show up in the current named policy. * * @param ptype the policy type, can be "p", "p2", "p3", .. * @return all the actions in policy rules of the ptype type. It actually * collects the 2-index elements of the policy rules. So make sure * your action is the 2-index element, like (sub, obj, act). * Duplicates are removed. */ getAllNamedActions(ptype: string): Promise; /** * getAllRoles gets the list of roles that show up in the current policy. * * @return all the roles in "g" policy rules. It actually collects * the 1-index elements of "g" policy rules. So make sure your * role is the 1-index element, like (sub, role). * Duplicates are removed. */ getAllRoles(): Promise; /** * getAllNamedRoles gets the list of roles that show up in the current named policy. * * @param ptype the policy type, can be "g", "g2", "g3", .. * @return all the subjects in policy rules of the ptype type. It actually * collects the 0-index elements of the policy rules. So make * sure your subject is the 0-index element, like (sub, obj, act). * Duplicates are removed. */ getAllNamedRoles(ptype: string): Promise; /** * getPolicy gets all the authorization rules in the policy. * * @return all the "p" policy rules. */ getPolicy(): Promise; /** * getFilteredPolicy gets all the authorization rules in the policy, field filters can be specified. * * @param fieldIndex the policy rule's start index to be matched. * @param fieldValues the field values to be matched, value "" * means not to match this field. * @return the filtered "p" policy rules. */ getFilteredPolicy(fieldIndex: number, ...fieldValues: string[]): Promise; /** * getNamedPolicy gets all the authorization rules in the named policy. * * @param ptype the policy type, can be "p", "p2", "p3", .. * @return the "p" policy rules of the specified ptype. */ getNamedPolicy(ptype: string): Promise; /** * getFilteredNamedPolicy gets all the authorization rules in the named policy, field filters can be specified. * * @param ptype the policy type, can be "p", "p2", "p3", .. * @param fieldIndex the policy rule's start index to be matched. * @param fieldValues the field values to be matched, value "" * means not to match this field. * @return the filtered "p" policy rules of the specified ptype. */ getFilteredNamedPolicy(ptype: string, fieldIndex: number, ...fieldValues: string[]): Promise; /** * getGroupingPolicy gets all the role inheritance rules in the policy. * * @return all the "g" policy rules. */ getGroupingPolicy(): Promise; /** * getFilteredGroupingPolicy gets all the role inheritance rules in the policy, field filters can be specified. * * @param fieldIndex the policy rule's start index to be matched. * @param fieldValues the field values to be matched, value "" means not to match this field. * @return the filtered "g" policy rules. */ getFilteredGroupingPolicy(fieldIndex: number, ...fieldValues: string[]): Promise; /** * getNamedGroupingPolicy gets all the role inheritance rules in the policy. * * @param ptype the policy type, can be "g", "g2", "g3", .. * @return the "g" policy rules of the specified ptype. */ getNamedGroupingPolicy(ptype: string): Promise; /** * getFilteredNamedGroupingPolicy gets all the role inheritance rules in the policy, field filters can be specified. * * @param ptype the policy type, can be "g", "g2", "g3", .. * @param fieldIndex the policy rule's start index to be matched. * @param fieldValues the field values to be matched, value "" * means not to match this field. * @return the filtered "g" policy rules of the specified ptype. */ getFilteredNamedGroupingPolicy(ptype: string, fieldIndex: number, ...fieldValues: string[]): Promise; /** * hasPolicy determines whether an authorization rule exists. * * @param params the "p" policy rule, ptype "p" is implicitly used. * @return whether the rule exists. */ hasPolicy(...params: string[]): Promise; /** * hasNamedPolicy determines whether a named authorization rule exists. * * @param ptype the policy type, can be "p", "p2", "p3", .. * @param params the "p" policy rule. * @return whether the rule exists. */ hasNamedPolicy(ptype: string, ...params: string[]): Promise; /** * addPolicy adds an authorization rule to the current policy. * If the rule already exists, the function returns false and the rule will not be added. * Otherwise the function returns true by adding the new rule. * * @param params the "p" policy rule, ptype "p" is implicitly used. * @return succeeds or not. */ addPolicy(...params: string[]): Promise; /** * addPolicies adds authorization rules to the current policy. * If the rule already exists, the function returns false and the rules will not be added. * Otherwise the function returns true by adding the new rules. * * @param rules the "p" policy rules, ptype "p" is implicitly used. * @return succeeds or not. */ addPolicies(rules: string[][]): Promise; /** * addNamedPolicy adds an authorization rule to the current named policy. * If the rule already exists, the function returns false and the rule will not be added. * Otherwise the function returns true by adding the new rule. * * @param ptype the policy type, can be "p", "p2", "p3", .. * @param params the "p" policy rule. * @return succeeds or not. */ addNamedPolicy(ptype: string, ...params: string[]): Promise; /** * addNamedPolicies adds authorization rules to the current named policy. * If the rule already exists, the function returns false and the rules will not be added. * Otherwise the function returns true by adding the new rules. * * @param ptype the policy type, can be "p", "p2", "p3", .. * @param rules the "p" policy rules. * @return succeeds or not. */ addNamedPolicies(ptype: string, rules: string[][]): Promise; /** * updatePolicy updates an authorization rule from the current policy. * If the rule not exists, the function returns false. * Otherwise the function returns true by changing it to the new rule. * * @return succeeds or not. * @param oldRule the policy will be remove * @param newRule the policy will be added */ updatePolicy(oldRule: string[], newRule: string[]): Promise; /** * updateNamedPolicy updates an authorization rule from the current named policy. * If the rule not exists, the function returns false. * Otherwise the function returns true by changing it to the new rule. * * @param ptype the policy type, can be "p", "p2", "p3", .. * @param oldRule the policy rule will be remove * @param newRule the policy rule will be added * @return succeeds or not. */ updateNamedPolicy(ptype: string, oldRule: string[], newRule: string[]): Promise; /** * removePolicy removes an authorization rule from the current policy. * * @param params the "p" policy rule, ptype "p" is implicitly used. * @return succeeds or not. */ removePolicy(...params: string[]): Promise; /** * removePolicies removes an authorization rules from the current policy. * * @param rules the "p" policy rules, ptype "p" is implicitly used. * @return succeeds or not. */ removePolicies(rules: string[][]): Promise; /** * removeFilteredPolicy removes an authorization rule from the current policy, field filters can be specified. * * @param fieldIndex the policy rule's start index to be matched. * @param fieldValues the field values to be matched, value "" * means not to match this field. * @return succeeds or not. */ removeFilteredPolicy(fieldIndex: number, ...fieldValues: string[]): Promise; /** * removeNamedPolicy removes an authorization rule from the current named policy. * * @param ptype the policy type, can be "p", "p2", "p3", .. * @param params the "p" policy rule. * @return succeeds or not. */ removeNamedPolicy(ptype: string, ...params: string[]): Promise; /** * removeNamedPolicies removes authorization rules from the current named policy. * * @param ptype the policy type, can be "p", "p2", "p3", .. * @param rules the "p" policy rules. * @return succeeds or not. */ removeNamedPolicies(ptype: string, rules: string[][]): Promise; /** * removeFilteredNamedPolicy removes an authorization rule from the current named policy, field filters can be specified. * * @param ptype the policy type, can be "p", "p2", "p3", .. * @param fieldIndex the policy rule's start index to be matched. * @param fieldValues the field values to be matched, value "" * means not to match this field. * @return succeeds or not. */ removeFilteredNamedPolicy(ptype: string, fieldIndex: number, ...fieldValues: string[]): Promise; /** * hasGroupingPolicy determines whether a role inheritance rule exists. * * @param params the "g" policy rule, ptype "g" is implicitly used. * @return whether the rule exists. */ hasGroupingPolicy(...params: string[]): Promise; /** * hasNamedGroupingPolicy determines whether a named role inheritance rule exists. * * @param ptype the policy type, can be "g", "g2", "g3", .. * @param params the "g" policy rule. * @return whether the rule exists. */ hasNamedGroupingPolicy(ptype: string, ...params: string[]): Promise; /** * addGroupingPolicy adds a role inheritance rule to the current policy. * If the rule already exists, the function returns false and the rule will not be added. * Otherwise the function returns true by adding the new rule. * * @param params the "g" policy rule, ptype "g" is implicitly used. * @return succeeds or not. */ addGroupingPolicy(...params: string[]): Promise; /** * addGroupingPolicies adds a role inheritance rules to the current policy. * If the rule already exists, the function returns false and the rules will not be added. * Otherwise the function returns true by adding the new rules. * * @param rules the "g" policy rules, ptype "g" is implicitly used. * @return succeeds or not. */ addGroupingPolicies(rules: string[][]): Promise; /** * addNamedGroupingPolicy adds a named role inheritance rule to the current policy. * If the rule already exists, the function returns false and the rule will not be added. * Otherwise the function returns true by adding the new rule. * * @param ptype the policy type, can be "g", "g2", "g3", .. * @param params the "g" policy rule. * @return succeeds or not. */ addNamedGroupingPolicy(ptype: string, ...params: string[]): Promise; /** * addNamedGroupingPolicies adds named role inheritance rules to the current policy. * If the rule already exists, the function returns false and the rules will not be added. * Otherwise the function returns true by adding the new rules. * * @param ptype the policy type, can be "g", "g2", "g3", .. * @param rules the "g" policy rule. * @return succeeds or not. */ addNamedGroupingPolicies(ptype: string, rules: string[][]): Promise; /** * removeGroupingPolicy removes a role inheritance rule from the current policy. * * @param params the "g" policy rule, ptype "g" is implicitly used. * @return succeeds or not. */ removeGroupingPolicy(...params: string[]): Promise; /** * removeGroupingPolicies removes role inheritance rules from the current policy. * * @param rules the "g" policy rules, ptype "g" is implicitly used. * @return succeeds or not. */ removeGroupingPolicies(rules: string[][]): Promise; /** * removeFilteredGroupingPolicy removes a role inheritance rule from the current policy, field filters can be specified. * * @param fieldIndex the policy rule's start index to be matched. * @param fieldValues the field values to be matched, value "" * means not to match this field. * @return succeeds or not. */ removeFilteredGroupingPolicy(fieldIndex: number, ...fieldValues: string[]): Promise; /** * removeNamedGroupingPolicy removes a role inheritance rule from the current named policy. * * @param ptype the policy type, can be "g", "g2", "g3", .. * @param params the "g" policy rule. * @return succeeds or not. */ removeNamedGroupingPolicy(ptype: string, ...params: string[]): Promise; /** * removeNamedGroupingPolicies removes role inheritance rules from the current named policy. * * @param ptype the policy type, can be "g", "g2", "g3", .. * @param rules the "g" policy rules. * @return succeeds or not. */ removeNamedGroupingPolicies(ptype: string, rules: string[][]): Promise; /** * removeFilteredNamedGroupingPolicy removes a role inheritance rule from the current named policy, field filters can be specified. * * @param ptype the policy type, can be "g", "g2", "g3", .. * @param fieldIndex the policy rule's start index to be matched. * @param fieldValues the field values to be matched, value "" * means not to match this field. * @return succeeds or not. */ removeFilteredNamedGroupingPolicy(ptype: string, fieldIndex: number, ...fieldValues: string[]): Promise; /** * UpdateGroupingPolicy updates an rule to the current named policy. * * @param oldRule the old rule. * @param newRule the new rule. * @return succeeds or not. */ updateGroupingPolicy(oldRule: string[], newRule: string[]): Promise; /** * updateNamedGroupingPolicy updates an rule to the current named policy. * * @param ptype the policy type, can be "g", "g2", "g3", .. * @param oldRule the old rule. * @param newRule the new rule. * @return succeeds or not. */ updateNamedGroupingPolicy(ptype: string, oldRule: string[], newRule: string[]): Promise; /** * addFunction adds a customized function. * @param name custom function name * @param func function */ addFunction(name: string, func: MatchingFunction): Promise; selfAddPolicy(sec: string, ptype: string, rule: string[]): Promise; selfRemovePolicy(sec: string, ptype: string, rule: string[]): Promise; selfRemoveFilteredPolicy(sec: string, ptype: string, fieldIndex: number, fieldValues: string[]): Promise; selfUpdatePolicy(sec: string, ptype: string, oldRule: string[], newRule: string[]): Promise; selfAddPolicies(sec: string, ptype: string, rule: string[][]): Promise; selfRemovePolicies(sec: string, ptype: string, rule: string[][]): Promise; }