Subversion Repositories XServices

Rev

Rev 198 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 198 Rev 199
Line 14... Line 14...
14
 *   limitations under the License.
14
 *   limitations under the License.
15
*/
15
*/
Line 16... Line 16...
16
 
16
 
Line 17... Line 17...
17
package net.brutex.xservices.security;
17
package net.brutex.xservices.security;
18
 
-
 
19
import org.apache.logging.log4j.Logger;
18
 
Line 20... Line 19...
20
import org.apache.logging.log4j.LogManager;
19
import lombok.extern.slf4j.Slf4j;
21
import org.apache.shiro.authz.Permission;
20
import org.apache.shiro.authz.Permission;
22
 
21
 
23
/**
22
/**
-
 
23
 * @author Brian Rosenberger, bru(at)brutex.de
24
 * @author Brian Rosenberger, bru(at)brutex.de
24
 *
Line 25... Line -...
25
 *
-
 
26
 */
25
 */
Line 27... Line 26...
27
public class XmlServicePermission implements Permission {
26
@Slf4j
28
 
27
public class XmlServicePermission implements Permission {
29
	private final Logger logger = LogManager.getLogger();
28
 
30
	private final String permissionString;
29
	private final String permissionString;
Line 31... Line 30...
31
 
30
 
32
	public XmlServicePermission(String permissionString) {
31
	public XmlServicePermission(String permissionString) {
33
		logger.debug(String.format("Creating permission for '%s'", permissionString));
32
		log.debug(String.format("Creating permission for '{}'", permissionString));
Line 34... Line 33...
34
		this.permissionString = permissionString;
33
		this.permissionString = permissionString;
35
	}
34
	}
36
	
35
	
37
	@Override
36
	@Override
38
	public boolean implies(Permission p) {
37
	public boolean implies(Permission p) {
Line 39... Line 38...
39
		boolean result = false;
38
		boolean result = false;
40
		
39
		
41
		/* is of same type */
40
		/* is of same type */
42
		if(! (p instanceof XmlServicePermission)) {			
41
		if(! (p instanceof XmlServicePermission)) {			
43
			logger.debug(String.format("Testing if permission of type '%s' implies permission of type '%s'. Result was '%s'"  , this.getClass(), p.getClass(), result));
42
			log.debug(String.format("Testing if permission of type '{}' implies permission of type '{}'. Result was '{}'"  , this.getClass(), p.getClass(), result));
Line 44... Line 43...
44
			return result;
43
			return result;
45
		}
44
		}