summaryrefslogtreecommitdiffstats
path: root/ipa-python/aci.py
diff options
context:
space:
mode:
authorKevin McCarthy <kmccarth@redhat.com>2007-10-15 13:07:39 -0700
committerKevin McCarthy <kmccarth@redhat.com>2007-10-15 13:07:39 -0700
commit233915b780f6edf01d5850ec69428f12c06a9f08 (patch)
treebfcba3abcd9fe3663057ce2bb68fd4fbc4bffea7 /ipa-python/aci.py
parentfbbdd27b5389ccbafa3fea8608b412759093cb69 (diff)
downloadfreeipa-233915b780f6edf01d5850ec69428f12c06a9f08.tar.gz
freeipa-233915b780f6edf01d5850ec69428f12c06a9f08.tar.xz
freeipa-233915b780f6edf01d5850ec69428f12c06a9f08.zip
Add basic delegation editing.
Diffstat (limited to 'ipa-python/aci.py')
-rw-r--r--ipa-python/aci.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/ipa-python/aci.py b/ipa-python/aci.py
index 137d9ee1d..092285e2a 100644
--- a/ipa-python/aci.py
+++ b/ipa-python/aci.py
@@ -18,6 +18,8 @@
import re
import urllib
+import ipa.ipautil
+
class ACI:
"""
Holds the basic data for an ACI entry, as stored in the cn=accounts
@@ -30,6 +32,7 @@ class ACI:
self.source_group = ''
self.dest_group = ''
self.attrs = []
+ self.orig_acistr = acistr
if acistr is not None:
self.parse_acistr(acistr)
@@ -52,6 +55,16 @@ class ACI:
urllib.quote(self.source_group, "/=, "))
return acistr
+ def to_dict(self):
+ result = ipa.ipautil.CIDict()
+ result['name'] = self.name
+ result['source_group'] = self.source_group
+ result['dest_group'] = self.dest_group
+ result['attrs'] = self.attrs
+ result['orig_acistr'] = self.orig_acistr
+
+ return result
+
def _match(self, prefix, inputstr):
"""Returns inputstr with prefix removed, or else raises a
SyntaxError."""
@@ -90,6 +103,8 @@ class ACI:
def parse_acistr(self, acistr):
"""Parses the acistr. If the string isn't recognized, a SyntaxError
is raised."""
+ self.orig_acistr = acistr
+
acistr = self._match('(targetattr=', acistr)
(attrstr, acistr) = self._match_str(acistr)
self.attrs = attrstr.split(' || ')