Project

General

Profile

« Previous | Next » 

Revision 5443

Added by berkley over 14 years ago

fix for set access bug

View differences:

src/edu/ucsb/nceas/metacat/dataone/CrudService.java
343 343
                String permission = (String)ah.get("permission");
344 344
                String permissionType = (String)ah.get("permission_type");
345 345
                String permissionOrder = (String)ah.get("permission_order");
346
                this.setAccess(token, guid, principal, permission, permissionType, permissionOrder, false);
346
                int perm = new Integer(permission).intValue();
347
                this.setAccess(token, guid, principal, perm, permissionType, permissionOrder, false);
347 348
            }
348 349
        }
349 350
        catch(Exception e)
......
417 418
    }
418 419
    
419 420
    /**
421
     * set access control on the doc
422
     * @param token
423
     * @param id
424
     * @param principal
425
     * @param permission
426
     */
427
    public void setAccess(AuthToken token, Identifier id, String principal, int permission,
428
      String permissionType, String permissionOrder, boolean setSystemMetadata)
429
      throws ServiceFailure
430
    {
431
        String perm = "";
432
        if(permission == 4)
433
        {
434
            perm = "read";
435
        }
436
        if(permission == 6)
437
        {
438
            perm = "write";
439
        }
440
        setAccess(token, id, principal, perm, permissionType, permissionOrder,
441
                setSystemMetadata);
442
       
443
    }
444
    
445
    /**
420 446
     * set the permission on the document
421 447
     * @param token
422 448
     * @param principal

Also available in: Unified diff