Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
Permissible.java
1 package org.bukkit.permissions;
2 
3 import java.util.Set;
4 import org.bukkit.plugin.Plugin;
5 
6 /**
7  * Represents an object that may be assigned permissions
8  */
9 public interface Permissible extends ServerOperator {
10 
11  /**
12  * Checks if this object contains an override for the specified
13  * permission, by fully qualified name
14  *
15  * @param name Name of the permission
16  * @return true if the permission is set, otherwise false
17  */
18  public boolean isPermissionSet(String name);
19 
20  /**
21  * Checks if this object contains an override for the specified {@link
22  * Permission}
23  *
24  * @param perm Permission to check
25  * @return true if the permission is set, otherwise false
26  */
27  public boolean isPermissionSet(Permission perm);
28 
29  /**
30  * Gets the value of the specified permission, if set.
31  * <p>
32  * If a permission override is not set on this object, the default value
33  * of the permission will be returned.
34  *
35  * @param name Name of the permission
36  * @return Value of the permission
37  */
38  public boolean hasPermission(String name);
39 
40  /**
41  * Gets the value of the specified permission, if set.
42  * <p>
43  * If a permission override is not set on this object, the default value
44  * of the permission will be returned
45  *
46  * @param perm Permission to get
47  * @return Value of the permission
48  */
49  public boolean hasPermission(Permission perm);
50 
51  /**
52  * Adds a new {@link PermissionAttachment} with a single permission by
53  * name and value
54  *
55  * @param plugin Plugin responsible for this attachment, may not be null
56  * or disabled
57  * @param name Name of the permission to attach
58  * @param value Value of the permission
59  * @return The PermissionAttachment that was just created
60  */
61  public PermissionAttachment addAttachment(Plugin plugin, String name, boolean value);
62 
63  /**
64  * Adds a new empty {@link PermissionAttachment} to this object
65  *
66  * @param plugin Plugin responsible for this attachment, may not be null
67  * or disabled
68  * @return The PermissionAttachment that was just created
69  */
71 
72  /**
73  * Temporarily adds a new {@link PermissionAttachment} with a single
74  * permission by name and value
75  *
76  * @param plugin Plugin responsible for this attachment, may not be null
77  * or disabled
78  * @param name Name of the permission to attach
79  * @param value Value of the permission
80  * @param ticks Amount of ticks to automatically remove this attachment
81  * after
82  * @return The PermissionAttachment that was just created
83  */
84  public PermissionAttachment addAttachment(Plugin plugin, String name, boolean value, int ticks);
85 
86  /**
87  * Temporarily adds a new empty {@link PermissionAttachment} to this
88  * object
89  *
90  * @param plugin Plugin responsible for this attachment, may not be null
91  * or disabled
92  * @param ticks Amount of ticks to automatically remove this attachment
93  * after
94  * @return The PermissionAttachment that was just created
95  */
96  public PermissionAttachment addAttachment(Plugin plugin, int ticks);
97 
98  /**
99  * Removes the given {@link PermissionAttachment} from this object
100  *
101  * @param attachment Attachment to remove
102  * @throws IllegalArgumentException Thrown when the specified attachment
103  * isn't part of this object
104  */
105  public void removeAttachment(PermissionAttachment attachment);
106 
107  /**
108  * Recalculates the permissions for this object, if the attachments have
109  * changed values.
110  * <p>
111  * This should very rarely need to be called from a plugin.
112  */
113  public void recalculatePermissions();
114 
115  /**
116  * Gets a set containing all of the permissions currently in effect by
117  * this object
118  *
119  * @return Set of currently effective permissions
120  */
121  public Set<PermissionAttachmentInfo> getEffectivePermissions();
122 }
PermissionAttachment addAttachment(Plugin plugin, String name, boolean value)
void removeAttachment(PermissionAttachment attachment)
boolean hasPermission(String name)
Set< PermissionAttachmentInfo > getEffectivePermissions()
boolean isPermissionSet(String name)