This project has retired. For details please refer to its
Attic page.
Permission xref
1 package org.apache.archiva.redback.rest.api.model;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 import javax.xml.bind.annotation.XmlRootElement;
22 import java.io.Serializable;
23
24
25
26
27
28 @XmlRootElement( name = "permission" )
29 public class Permission
30 implements Serializable
31 {
32 private String name;
33
34 private String description;
35
36 private Operation operation;
37
38 private Resource resource;
39
40 private boolean permanent;
41
42 public Permission()
43 {
44
45 }
46
47 public Permission( org.apache.archiva.redback.rbac.Permission permission )
48 {
49 this.name = permission.getName();
50 this.description = permission.getDescription();
51 this.operation = permission.getOperation() == null ? null : new Operation( permission.getOperation() );
52 this.resource = permission.getResource() == null ? null : new Resource( permission.getResource() );
53 this.permanent = permission.isPermanent();
54 }
55
56 public String getName()
57 {
58 return name;
59 }
60
61 public void setName( String name )
62 {
63 this.name = name;
64 }
65
66 public Operation getOperation()
67 {
68 return operation;
69 }
70
71 public void setOperation( Operation operation )
72 {
73 this.operation = operation;
74 }
75
76 public Resource getResource()
77 {
78 return resource;
79 }
80
81 public void setResource( Resource resource )
82 {
83 this.resource = resource;
84 }
85
86 @Override
87 public String toString()
88 {
89 final StringBuilder sb = new StringBuilder();
90 sb.append( "Permission" );
91 sb.append( "{name='" ).append( name ).append( '\'' );
92 sb.append( ", description='" ).append( description ).append( '\'' );
93 sb.append( ", operation=" ).append( operation );
94 sb.append( ", resource=" ).append( resource );
95 sb.append( ", permanent=" ).append( permanent );
96 sb.append( '}' );
97 return sb.toString();
98 }
99 }