diff create_features_from_gff3.py @ 5:207c1c281360 draft

planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/apollo commit 85194fa009ead2c34720faab61a4143fc29d17c2
author gga
date Fri, 31 Aug 2018 09:33:49 -0400
parents a10003dc6c85
children c6172b538caf
line wrap: on
line diff
--- a/create_features_from_gff3.py	Mon Mar 12 06:31:48 2018 -0400
+++ b/create_features_from_gff3.py	Fri Aug 31 09:33:49 2018 -0400
@@ -8,7 +8,7 @@
 
 from six.moves.builtins import str
 
-from webapollo import AssertUser, GuessOrg, OrgOrGuess, WAAuth, WebApolloInstance, featuresToFeatureSchema, retry
+from webapollo import GuessOrg, OrgOrGuess, PermissionCheck, WAAuth, WebApolloInstance, featuresToFeatureSchema, retry
 logging.basicConfig(level=logging.INFO)
 log = logging.getLogger(__name__)
 
@@ -25,14 +25,15 @@
 
     wa = WebApolloInstance(args.apollo, args.username, args.password)
     # User must have an account
-    gx_user = AssertUser(wa.users.loadUsers(email=args.email))
+    gx_user = wa.users.assertOrCreateUser(args.email)
 
     # Get organism
     org_cn = GuessOrg(args, wa)
     if isinstance(org_cn, list):
         org_cn = org_cn[0]
 
-    # TODO: Check user perms on org.
+    if not PermissionCheck(gx_user, org_cn, "WRITE"):
+        raise Exception("Action not permitted")
     org = wa.organisms.findOrganismByCn(org_cn)
 
     bad_quals = ['date_creation', 'source', 'owner', 'date_last_modified', 'Name', 'ID']