Commit b8d4ba9e authored by Sofia Papagiannaki's avatar Sofia Papagiannaki
Browse files

Change add_user_policies call signature

parent 25be72a7
......@@ -159,13 +159,13 @@ class DjangoBackend(BaseBackend):
return self._details(u)
@safe
def add_policies(self, user_id, update=False, policies=()):
def add_policies(self, user_id, policies=()):
user = self._lookup_user(user_id)
rejected = []
append = rejected.append
for p in policies:
try:
user.add_resource_policy(**p, update=update)
user.add_resource_policy(**p)
except (ObjectDoesNotExist, IntegrityError), e:
append((service, resource, e))
return rejected
......
......@@ -81,9 +81,9 @@ class AstakosCallpoint():
rejected = (b.update_user(**u) for u in users)
return rejected
def add_user_policies(self, user_id, update=False, policies=()):
def add_user_policies(self, user_id, policies=()):
b = get_backend()
rejected = b.add_policies(user_id, update, policies)
rejected = b.add_policies(user_id, policies)
return rejected
def remove_user_policies(self, user_id, policies=()):
......
......@@ -62,7 +62,7 @@ class AstakosAPI(Specificator):
email_verified=Boolean),
policies=ListOf(
resource=Name, capacity=Nonnegative, quantity=Nonnegative,
import_limit, export_limit),
import_limit=Nonnegative, export_limit=Nonnegative),
groups=ListOf(Name),
permissions=ListOf(Name)
):
......@@ -96,8 +96,9 @@ class AstakosAPI(Specificator):
def add_user_policies(
self,
pk=Nonnegative,
update=Boolean,
policies=ListOf(service=Name, resource=Name, upimit=Nonnegative)
policies=ListOf(
resource=Name, capacity=Nonnegative, quantity=Nonnegative,
import_limit=Nonnegative, export_limit=Nonnegative, update=Boolean)
):
rejected = ListOf(resource=Name, reason=Text())
return rejected
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment