All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.chenillekit.access.annotations.Restricted Maven / Gradle / Ivy

/*
 * Apache License
 * Version 2.0, January 2004
 * http://www.apache.org/licenses/
 *
 * Copyright 2008-2010 by chenillekit.org
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 */

package org.chenillekit.access.annotations;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Annotation to hold role weight and/or group names the user
 * must fulfill in his profile to access a restricted page.
 *
 * @version $Id: Restricted.java 679 2010-08-01 20:54:46Z homburgs $
 */
@Target({ElementType.TYPE, ElementType.METHOD, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface Restricted
{
	/**
	 * @return the minimum role weight a user should own
	 */
	int role() default 0;

	/**
	 * @return the groups names (or ids if you like) a user should be listed in
	 */
	String[] groups() default {};
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy