本文整理汇总了Java中org.picketlink.Identity类的典型用法代码示例。如果您正苦于以下问题:Java Identity类的具体用法?Java Identity怎么用?Java Identity使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Identity类属于org.picketlink包,在下文中一共展示了Identity类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: testLoginChecker_1
import org.picketlink.Identity; //导入依赖的package包/类
/**
* Run the boolean loginChecker(Identity) method test.
*
* @throws Exception
*
* @generatedBy CodePro at 12/15/14 3:53 PM
*/
@Test
public void testLoginChecker_1()
throws Exception {
InternalSecurity fixture = new InternalSecurity();
Identity identity = new DefaultIdentity();
boolean result = fixture.loginChecker(identity);
// An unexpected exception was thrown in user code while executing this test:
// java.lang.NoClassDefFoundError: com_cenqua_clover/CoverageRecorder
// at com.intuit.tank.auth.InternalSecurity.loginChecker(InternalSecurity.java:36)
assertTrue(!result);
}
开发者ID:intuit,项目名称:Tank,代码行数:21,代码来源:InternalSecurityTest.java
示例2: testLoginChecker_2
import org.picketlink.Identity; //导入依赖的package包/类
/**
* Run the boolean loginChecker(Identity) method test.
*
* @throws Exception
*
* @generatedBy CodePro at 12/15/14 3:53 PM
*/
@Test
public void testLoginChecker_2()
throws Exception {
InternalSecurity fixture = new InternalSecurity();
Identity identity = new DefaultIdentity();
boolean result = fixture.loginChecker(identity);
// An unexpected exception was thrown in user code while executing this test:
// java.lang.NoClassDefFoundError: com_cenqua_clover/CoverageRecorder
// at com.intuit.tank.auth.InternalSecurity.loginChecker(InternalSecurity.java:36)
assertTrue(!result);
}
开发者ID:intuit,项目名称:Tank,代码行数:21,代码来源:InternalSecurityTest.java
示例3: testOwnerChecker_1
import org.picketlink.Identity; //导入依赖的package包/类
/**
* Run the boolean ownerChecker(Identity,OwnableEntity) method test.
*
* @throws Exception
*
* @generatedBy CodePro at 12/15/14 3:53 PM
*/
@Test
public void testOwnerChecker_1()
throws Exception {
InternalSecurity fixture = new InternalSecurity();
Identity identity = new DefaultIdentity();
OwnableEntity item = new ColumnPreferences();
boolean result = fixture.ownerChecker(identity, item);
// An unexpected exception was thrown in user code while executing this test:
// java.lang.NoClassDefFoundError: com_cenqua_clover/CoverageRecorder
// at com.intuit.tank.project.ColumnPreferences.<init>(ColumnPreferences.java:61)
assertTrue(!result);
}
开发者ID:intuit,项目名称:Tank,代码行数:22,代码来源:InternalSecurityTest.java
示例4: testOwnerChecker_2
import org.picketlink.Identity; //导入依赖的package包/类
/**
* Run the boolean ownerChecker(Identity,OwnableEntity) method test.
*
* @throws Exception
*
* @generatedBy CodePro at 12/15/14 3:53 PM
*/
@Test
public void testOwnerChecker_2()
throws Exception {
InternalSecurity fixture = new InternalSecurity();
Identity identity = new DefaultIdentity();
OwnableEntity item = new ColumnPreferences();
boolean result = fixture.ownerChecker(identity, item);
// An unexpected exception was thrown in user code while executing this test:
// java.lang.NoClassDefFoundError: com_cenqua_clover/CoverageRecorder
// at com.intuit.tank.project.ColumnPreferences.<init>(ColumnPreferences.java:61)
assertTrue(!result);
}
开发者ID:intuit,项目名称:Tank,代码行数:22,代码来源:InternalSecurityTest.java
示例5: testOwnerChecker_3
import org.picketlink.Identity; //导入依赖的package包/类
/**
* Run the boolean ownerChecker(Identity,OwnableEntity) method test.
*
* @throws Exception
*
* @generatedBy CodePro at 12/15/14 3:53 PM
*/
@Test
public void testOwnerChecker_3()
throws Exception {
InternalSecurity fixture = new InternalSecurity();
Identity identity = new DefaultIdentity();
OwnableEntity item = new ColumnPreferences();
boolean result = fixture.ownerChecker(identity, item);
// An unexpected exception was thrown in user code while executing this test:
// java.lang.NoClassDefFoundError: com_cenqua_clover/CoverageRecorder
// at com.intuit.tank.project.ColumnPreferences.<init>(ColumnPreferences.java:61)
assertTrue(!result);
}
开发者ID:intuit,项目名称:Tank,代码行数:22,代码来源:InternalSecurityTest.java
示例6: testOwnerChecker_4
import org.picketlink.Identity; //导入依赖的package包/类
/**
* Run the boolean ownerChecker(Identity,OwnableEntity) method test.
*
* @throws Exception
*
* @generatedBy CodePro at 12/15/14 3:53 PM
*/
@Test
public void testOwnerChecker_4()
throws Exception {
InternalSecurity fixture = new InternalSecurity();
Identity identity = new DefaultIdentity();
OwnableEntity item = new ColumnPreferences();
boolean result = fixture.ownerChecker(identity, item);
// An unexpected exception was thrown in user code while executing this test:
// java.lang.NoClassDefFoundError: com_cenqua_clover/CoverageRecorder
// at com.intuit.tank.project.ColumnPreferences.<init>(ColumnPreferences.java:61)
assertTrue(!result);
}
开发者ID:intuit,项目名称:Tank,代码行数:22,代码来源:InternalSecurityTest.java
示例7: checkAdmin
import org.picketlink.Identity; //导入依赖的package包/类
/**
* Checks to see if the user is currently logged in to the system by checking the Identity object.
*
* @param servletContext
* the servletContext
* @throws WebApplicationException
* if the user is not authenticated.
*/
public static void checkAdmin(ServletContext servletContext) throws WebApplicationException {
Identity identity = new ServletInjector<Identity>().getManagedBean(servletContext, Identity.class);
IdentityManager identityManager = new ServletInjector<IdentityManager>().getManagedBean(servletContext, IdentityManager.class);
RelationshipManager relationshipManager = new ServletInjector<RelationshipManager>().getManagedBean(servletContext, RelationshipManager.class);
if (identity == null
|| !hasRole(relationshipManager, identity.getAccount(), getRole(identityManager, TankConstants.TANK_GROUP_ADMIN))) {
throw new WebApplicationException(buildForbiddenResponse("Insuficient Rights"));
}
}
开发者ID:intuit,项目名称:Tank,代码行数:19,代码来源:AuthUtil.java
示例8: checkOwner
import org.picketlink.Identity; //导入依赖的package包/类
/**
* Checks to see if the user is currently logged in to the system by checking the Identity object.
*
* @param servletContext
* the servletContext
* @param ownable
* the entiry to check if the user has rights to
* @throws WebApplicationException
* if the user is not authenticated.
*/
public static void checkOwner(ServletContext servletContext, OwnableEntity ownable) throws WebApplicationException {
checkLoggedIn(servletContext);
Identity identity = new ServletInjector<Identity>().getManagedBean(servletContext, Identity.class);
IdentityManager identityManager = new ServletInjector<IdentityManager>().getManagedBean(servletContext, IdentityManager.class);
RelationshipManager relationshipManager = new ServletInjector<RelationshipManager>().getManagedBean(servletContext, RelationshipManager.class);
if (hasRole(relationshipManager, identity.getAccount(), getRole(identityManager, TankConstants.TANK_GROUP_ADMIN))) {
return;
}
if (StringUtils.isEmpty(ownable.getCreator()) || identity.getAccount().getId().equals(ownable.getCreator())) {
return;
}
throw new WebApplicationException(buildForbiddenResponse("Insufficient Rights"));
}
开发者ID:intuit,项目名称:Tank,代码行数:25,代码来源:AuthUtil.java
示例9: getAuthenticated
import org.picketlink.Identity; //导入依赖的package包/类
/**
* @return o usuario autenticado
*/
private User getAuthenticated() {
final Identity identity = BeansLocal.getInstance(
this.beanManager, Identity.class);
return (User) identity.getAccount();
}
开发者ID:arthurgregorio,项目名称:web-budget,代码行数:11,代码来源:PersistentEntityListener.java
示例10: adminChecker
import org.picketlink.Identity; //导入依赖的package包/类
@Secures
@Admin
public boolean adminChecker(Identity identity) {
return hasRole(relationshipManager, identity.getAccount(), getRole(identityManager, TankConstants.TANK_GROUP_ADMIN));
}
开发者ID:intuit,项目名称:Tank,代码行数:6,代码来源:InternalSecurity.java
示例11: loginChecker
import org.picketlink.Identity; //导入依赖的package包/类
@Secures
@TsLoggedIn
public boolean loginChecker(Identity identity) {
return identity.isLoggedIn();
}
开发者ID:intuit,项目名称:Tank,代码行数:6,代码来源:InternalSecurity.java
示例12: ownerChecker
import org.picketlink.Identity; //导入依赖的package包/类
@Secures
@Owner
public boolean ownerChecker(Identity identity, @Current OwnableEntity item) {
return identity.isLoggedIn()
&& (StringUtils.isEmpty(item.getCreator()) || identityManager.lookupById(User.class, identity.getAccount().getId()).getLoginName().equals(item.getCreator()));
}
开发者ID:intuit,项目名称:Tank,代码行数:7,代码来源:InternalSecurity.java
示例13: depricate
import org.picketlink.Identity; //导入依赖的package包/类
@Secures
@DepricatedView
public boolean depricate(Identity identity) {
return false;
}
开发者ID:intuit,项目名称:Tank,代码行数:6,代码来源:InternalSecurity.java
示例14: checkLoggedIn
import org.picketlink.Identity; //导入依赖的package包/类
@Secures @LoggedIn
public boolean checkLoggedIn(Identity identity)
{
return identity.isLoggedIn();
}
开发者ID:forgeide,项目名称:forgeide,代码行数:6,代码来源:CustomAuthorizer.java
示例15: checkLoggedIn
import org.picketlink.Identity; //导入依赖的package包/类
/**
* Checks to see if the user is currently logged in to the system by checking the Identity object.
*
* @param servletContext
* the servletContext
* @throws WebApplicationException
* if the user is not authenticated.
*/
public static void checkLoggedIn(ServletContext servletContext) throws WebApplicationException {
Identity identity = new ServletInjector<Identity>().getManagedBean(servletContext, Identity.class);
if (identity == null || !identity.isLoggedIn()) {
throw new WebApplicationException(buildForbiddenResponse("Login Required"));
}
}
开发者ID:intuit,项目名称:Tank,代码行数:15,代码来源:AuthUtil.java
注:本文中的org.picketlink.Identity类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论