Class InternalEnforcer

    • Constructor Detail

      • InternalEnforcer

        InternalEnforcer()
    • Method Detail

      • notifyWatcher

        private boolean notifyWatcher​(java.lang.String sec,
                                      java.lang.String ptype,
                                      java.util.List<java.util.List<java.lang.String>> rules,
                                      WatcherEx.UpdateType updateType)
        Parameters:
        sec - the section, "p" or "g".
        ptype - the policy type, "p", "p2", .. or "g", "g2", ..
        rules - the policies
        updateType - the UpdateType
        Returns:
        indicate whether the notification to the Watcher is successful or not
      • addPolicy

        boolean addPolicy​(java.lang.String sec,
                          java.lang.String ptype,
                          java.util.List<java.lang.String> rule)
        addPolicy adds a rule to the current policy.
      • addPolicies

        boolean addPolicies​(java.lang.String sec,
                            java.lang.String ptype,
                            java.util.List<java.util.List<java.lang.String>> rules,
                            boolean autoRemoveRepeat)
        addPolicies adds rules to the current policy.
      • buildIncrementalRoleLinks

        public void buildIncrementalRoleLinks​(Model.PolicyOperations op,
                                              java.lang.String ptype,
                                              java.util.List<java.util.List<java.lang.String>> rules)
        buildIncrementalRoleLinks provides incremental build the role inheritance relations.
        Parameters:
        op - Policy operations.
        ptype - policy type.
        rules - the rules.
      • removePolicy

        boolean removePolicy​(java.lang.String sec,
                             java.lang.String ptype,
                             java.util.List<java.lang.String> rule)
        removePolicy removes a rule from the current policy.
      • updatePolicy

        boolean updatePolicy​(java.lang.String sec,
                             java.lang.String ptype,
                             java.util.List<java.lang.String> oldRule,
                             java.util.List<java.lang.String> newRule)
        updatePolicy updates an authorization rule from the current policy.
        Parameters:
        sec - the section, "p" or "g".
        ptype - the policy type, "p", "p2", .. or "g", "g2", ..
        oldRule - the old rule.
        newRule - the new rule.
        Returns:
        succeeds or not.
      • removePolicies

        boolean removePolicies​(java.lang.String sec,
                               java.lang.String ptype,
                               java.util.List<java.util.List<java.lang.String>> rules)
        removePolicies removes rules from the current policy.
      • removeFilteredPolicy

        boolean removeFilteredPolicy​(java.lang.String sec,
                                     java.lang.String ptype,
                                     int fieldIndex,
                                     java.lang.String... fieldValues)
        removeFilteredPolicy removes rules based on field filters from the current policy.
      • getDomainIndex

        int getDomainIndex​(java.lang.String ptype)
      • buildIncrementalRoleLinks

        private void buildIncrementalRoleLinks​(java.lang.String sec,
                                               java.lang.String ptype,
                                               java.util.List<java.util.List<java.lang.String>> rules,
                                               Model.PolicyOperations operation)