core: security attribute added to the parameters

- getParams, getParamsUI and getParamsForCategory have a security_limit parameter to filter
- parameters with security = 0 can be retrieved/modified from Libervia
This commit is contained in:
souliane 2013-09-05 20:28:44 +02:00
commit 7652fd3a15
3 changed files with 126 additions and 71 deletions

View file

@ -301,10 +301,10 @@ class DbusObject(dbus.service.Object):
return self._callback("getParamA", unicode(name), unicode(category), unicode(attribute), unicode(profile_key))
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
in_signature='s', out_signature='s',
in_signature='is', out_signature='s',
async_callbacks=('callback', 'errback'))
def getParams(self, profile_key="@DEFAULT@", callback=None, errback=None):
return self._callback("getParams", unicode(profile_key), callback=callback, errback=errback)
def getParams(self, security_limit=-1, profile_key="@DEFAULT@", callback=None, errback=None):
return self._callback("getParams", security_limit, unicode(profile_key), callback=callback, errback=errback)
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
in_signature='', out_signature='as',
@ -313,16 +313,16 @@ class DbusObject(dbus.service.Object):
return self._callback("getParamsCategories", )
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
in_signature='ss', out_signature='s',
in_signature='sis', out_signature='s',
async_callbacks=('callback', 'errback'))
def getParamsForCategory(self, category, profile_key="@DEFAULT@", callback=None, errback=None):
return self._callback("getParamsForCategory", unicode(category), unicode(profile_key), callback=callback, errback=errback)
def getParamsForCategory(self, category, security_limit=-1, profile_key="@DEFAULT@", callback=None, errback=None):
return self._callback("getParamsForCategory", unicode(category), security_limit, unicode(profile_key), callback=callback, errback=errback)
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
in_signature='s', out_signature='s',
in_signature='is', out_signature='s',
async_callbacks=('callback', 'errback'))
def getParamsUI(self, profile_key="@DEFAULT@", callback=None, errback=None):
return self._callback("getParamsUI", unicode(profile_key), callback=callback, errback=errback)
def getParamsUI(self, security_limit=-1, profile_key="@DEFAULT@", callback=None, errback=None):
return self._callback("getParamsUI", security_limit, unicode(profile_key), callback=callback, errback=errback)
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
in_signature='s', out_signature='a{sa{s(sia{ss})}}',

View file

@ -59,7 +59,7 @@ class Bridge(object):
def getParam(self, name, namespace):
raise NotImplementedError
def getParams(self, namespace):
def getParams(self, security_limit, namespace):
raise NotImplementedError
def getHistory(self, from_jid, to_jid, size):

View file

@ -436,32 +436,38 @@ doc_param_3=%(doc_profile_key)s
async=
type=method
category=core
sig_in=s
sig_in=is
sig_out=s
param_0_default="@DEFAULT@"
param_0_default=-1
param_1_default="@DEFAULT@"
doc=Return a SàT XMLUI for parameters
doc_param_0=%(doc_profile_key)s
doc_param_0=security_limit: -1 means no security then the higher the most secure
doc_param_1=%(doc_profile_key)s
[getParams]
async=
type=method
category=core
sig_in=s
sig_in=is
sig_out=s
param_0_default="@DEFAULT@"
param_0_default=-1
param_1_default="@DEFAULT@"
doc=Return XML of parameters
doc_param_0=%(doc_profile_key)s
doc_param_0=security_limit: -1 means no security then the higher the most secure
doc_param_1=%(doc_profile_key)s
[getParamsForCategory]
async=
type=method
category=core
sig_in=ss
sig_in=sis
sig_out=s
param_1_default="@DEFAULT@"
param_1_default=-1
param_2_default="@DEFAULT@"
doc=Return a xml of all params in a category
doc_param_0=category: Category to get
doc_param_1=%(doc_profile_key)s
doc_param_1=security_limit: -1 means no security then the higher the most secure
doc_param_2=%(doc_profile_key)s
[getParamsCategories]
type=method