This is metadata for the UI. Adam, I took a guess at the things you need, not everything is defined since these aren't using the baseldap class (doesn't really make sense to since there isn't an object backing them).

Let me know if I missed something.

rob
>From 954aa4458dc5f274c3912cec8eca70f977001c2a Mon Sep 17 00:00:00 2001
From: Rob Crittenden <rcrit...@redhat.com>
Date: Mon, 13 Dec 2010 23:13:04 -0500
Subject: [PATCH] Add metadata for the selfservice and delegation plugins.

---
 ipalib/plugins/delegation.py  |   14 ++++++++++++++
 ipalib/plugins/selfservice.py |   14 ++++++++++++++
 2 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/ipalib/plugins/delegation.py b/ipalib/plugins/delegation.py
index de39a85..b9fc7f1 100644
--- a/ipalib/plugins/delegation.py
+++ b/ipalib/plugins/delegation.py
@@ -86,6 +86,9 @@ class delegation(Object):
     Delegation object.
     """
 
+    bindable = False
+    object_name = 'delegation',
+    object_name_plural = 'delegation',
     label = _('Delegation')
 
     takes_params = (
@@ -118,6 +121,17 @@ class delegation(Object):
         ),
     )
 
+    def __json__(self):
+        json_friendly_attributes = (
+            'label', 'takes_params', 'bindable', 'name',
+            'object_name', 'object_name_plural',
+        )
+        json_dict = dict(
+            (a, getattr(self, a)) for a in json_friendly_attributes
+        )
+        json_dict['methods'] = [m for m in self.methods]
+        return json_dict
+
 api.register(delegation)
 
 
diff --git a/ipalib/plugins/selfservice.py b/ipalib/plugins/selfservice.py
index 6d34715..63c40f6 100644
--- a/ipalib/plugins/selfservice.py
+++ b/ipalib/plugins/selfservice.py
@@ -67,6 +67,9 @@ class selfservice(Object):
     Selfservice object.
     """
 
+    bindable = False
+    object_name = 'selfservice',
+    object_name_plural = 'selfservice',
     label = _('Permissions')
 
     takes_params = (
@@ -89,6 +92,17 @@ class selfservice(Object):
         ),
     )
 
+    def __json__(self):
+        json_friendly_attributes = (
+            'label', 'takes_params', 'bindable', 'name',
+            'object_name', 'object_name_plural',
+        )
+        json_dict = dict(
+            (a, getattr(self, a)) for a in json_friendly_attributes
+        )
+        json_dict['methods'] = [m for m in self.methods]
+        return json_dict
+
 api.register(selfservice)
 
 
-- 
1.7.2.1

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to