• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Role类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中be.objectify.deadbolt.core.models.Role的典型用法代码示例。如果您正苦于以下问题:Java Role类的具体用法?Java Role怎么用?Java Role使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Role类属于be.objectify.deadbolt.core.models包,在下文中一共展示了Role类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: UserAccountFormData

import be.objectify.deadbolt.core.models.Role; //导入依赖的package包/类
/**
 * Creates a form data holder from a {@link IUserAccount}.
 * 
 * @param userAccount
 *            the user account
 */
public UserAccountFormData(IUserAccount userAccount) {
    this.administratorDefinedPassword = false;
    this.uid = userAccount.getUid();
    this.firstName = userAccount.getFirstName();
    this.lastName = userAccount.getLastName();
    this.mail = userAccount.getMail();
    this.accountType = userAccount.getAccountType().name();
    // Set the permissions
    for (Role role : userAccount.getRoles()) {
        this.permissions.add(role.getName());
    }
    // Set the roles
    for (String systemLevelRoleTypes : userAccount.getSystemLevelRoleTypeNames()) {
        this.systemLevelRoleTypes.add(systemLevelRoleTypes);
    }
    this.preferredLanguage = userAccount.getPreferredLanguage() != null ? userAccount.getPreferredLanguage().toLowerCase() : null;
}
 
开发者ID:theAgileFactory,项目名称:maf-desktop-app,代码行数:24,代码来源:UserManager.java


示例2: getSubject

import be.objectify.deadbolt.core.models.Role; //导入依赖的package包/类
@Override
public Promise<Optional<Subject>> getSubject(final Http.Context context) {
       if (context.session().get("username") != null && !context.session().get("username").isEmpty()) {
           // return an anonymous user
           return Promise.pure(Optional.of(new Subject() {
               @Override
               public List<? extends Role> getRoles() {
                   return Collections.emptyList();
               }

               @Override
               public List<? extends Permission> getPermissions() {
                   return Collections.emptyList();
               }

               @Override
               public String getIdentifier() {
                   return context.session().get("username");
               }
           }));
       } else {
           return Promise.pure(Optional.empty());
       }
}
 
开发者ID:thunderbit,项目名称:thunderbit,代码行数:25,代码来源:MyDeadboltHandler.java


示例3: isAllowed

import be.objectify.deadbolt.core.models.Role; //导入依赖的package包/类
public boolean isAllowed(String name, String meta, DeadboltHandler deadboltHandler, Http.Context context)
   {
boolean retVal = false;

Subject roleHolder = deadboltHandler.getSubject(context);

if (roleHolder != null && User.class.isAssignableFrom(roleHolder.getClass())) {
    List<? extends Role> roles = ((User) roleHolder).getRoles();
    UserRole role = UserRoles.forName(name);

    retVal = ((User) roleHolder).getRoles().contains(UserRoles.forName(name));
} else if (roleHolder != null) {
    Logger.warn("Encountered unknown role holder entity: " + roleHolder);
}

return retVal;
   }
 
开发者ID:beligum,项目名称:com.beligum.core.play,代码行数:18,代码来源:MyDynamicResourceHandler.java


示例4: getSelectableRoles

import be.objectify.deadbolt.core.models.Role; //导入依赖的package包/类
/**
 * This returns a list of {@link Role} which names are actually based on
 * {@link SystemPermission} names.
 */
@Override
public List<? extends Role> getSelectableRoles() {
    List<? extends Role> sorterRoles = Collections.synchronizedList(new ArrayList<>(this.selectableRoles));
    Collections.sort(sorterRoles, new Comparator<Role>() {
        @Override
        public int compare(Role role1, Role role2) {
            return role1.getName().compareTo(role2.getName());
        }
    });
    return sorterRoles;
}
 
开发者ID:theAgileFactory,项目名称:app-framework,代码行数:16,代码来源:AbstractDefaultCommonUserAccount.java


示例5: getSystemPermissionNames

import be.objectify.deadbolt.core.models.Role; //导入依赖的package包/类
@Override
public List<String> getSystemPermissionNames() {
    ArrayList<String> systemPermissions = new ArrayList<String>();
    for (Role deadBoltRole : getRoles()) {
        systemPermissions.add(deadBoltRole.getName());
    }
    return systemPermissions;
}
 
开发者ID:theAgileFactory,项目名称:app-framework,代码行数:9,代码来源:AbstractDefaultCommonUserAccount.java


示例6: getRoles

import be.objectify.deadbolt.core.models.Role; //导入依赖的package包/类
@Override
   public List<? extends Role> getRoles()
   {
if (this.roleLevel == null) {
    this.roleLevel = UserRoles.GUEST_ROLE.getLevel();
}
if (this.cachedRoles == null) {
    this.cachedRoles = UserRoles.forLevel(this.roleLevel);
}

return this.cachedRoles;
   }
 
开发者ID:beligum,项目名称:com.beligum.core.play,代码行数:13,代码来源:User.java


示例7: getPermissions

import be.objectify.deadbolt.core.models.Role; //导入依赖的package包/类
public List<UserPermission> getPermissions() {
	
	List<UserPermission> result = new ArrayList<>();
	
	// childrens permissions (recursion)
	for(Role child : children) {
		result.addAll(((SecurityRole)child).getPermissions());
	}
	
	// this permission
	result.addAll(permissions);
	
	return result;
}
 
开发者ID:stefanil,项目名称:play2-prototypen,代码行数:15,代码来源:SecurityRole.java


示例8: getRoles

import be.objectify.deadbolt.core.models.Role; //导入依赖的package包/类
/**
 * This returns a list of {@link Role} which names are actually based on
 * {@link SystemPermission} names.
 */
@Override
public List<? extends Role> getRoles() {
    return this.roles;
}
 
开发者ID:theAgileFactory,项目名称:app-framework,代码行数:9,代码来源:AbstractDefaultCommonUserAccount.java


示例9: addGroup

import be.objectify.deadbolt.core.models.Role; //导入依赖的package包/类
@Override
public void addGroup(Role role) {
    if (role != null) {
        this.roles.add(role);
    }
}
 
开发者ID:theAgileFactory,项目名称:app-framework,代码行数:7,代码来源:AbstractDefaultCommonUserAccount.java


示例10: addSelectableGroup

import be.objectify.deadbolt.core.models.Role; //导入依赖的package包/类
@Override
public void addSelectableGroup(Role role) {
    if (role != null) {
        this.selectableRoles.add(role);
    }
}
 
开发者ID:theAgileFactory,项目名称:app-framework,代码行数:7,代码来源:AbstractDefaultCommonUserAccount.java


示例11: getRoles

import be.objectify.deadbolt.core.models.Role; //导入依赖的package包/类
@Override
public List<? extends Role> getRoles()
{
    return roles;
}
 
开发者ID:play2-maven-plugin,项目名称:play2-maven-test-projects,代码行数:6,代码来源:AuthorisedUser.java


示例12: getRoles

import be.objectify.deadbolt.core.models.Role; //导入依赖的package包/类
@Override
public List<? extends Role> getRoles() {
	return this.roles;
}
 
开发者ID:LSIR,项目名称:gsn,代码行数:5,代码来源:User.java


示例13: getRoles

import be.objectify.deadbolt.core.models.Role; //导入依赖的package包/类
@Override
public List<? extends Role> getRoles() {
	return roles;
}
 
开发者ID:stefanil,项目名称:play2-prototypen,代码行数:5,代码来源:User.java


示例14: addGroup

import be.objectify.deadbolt.core.models.Role; //导入依赖的package包/类
/**
 * Add a role (actually the name of a {@link SystemPermission})
 */
public void addGroup(Role role);
 
开发者ID:theAgileFactory,项目名称:app-framework,代码行数:5,代码来源:ICommonUserAccount.java


示例15: addSelectableGroup

import be.objectify.deadbolt.core.models.Role; //导入依赖的package包/类
/**
 * Add a selectable role (actually the name of a {@link SystemPermission})
 */
public void addSelectableGroup(Role role);
 
开发者ID:theAgileFactory,项目名称:app-framework,代码行数:5,代码来源:ICommonUserAccount.java


示例16: getSelectableRoles

import be.objectify.deadbolt.core.models.Role; //导入依赖的package包/类
/**
 * Get the selectable roles.
 */
public List<? extends Role> getSelectableRoles();
 
开发者ID:theAgileFactory,项目名称:app-framework,代码行数:5,代码来源:IUserAccount.java



注:本文中的be.objectify.deadbolt.core.models.Role类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Entity类代码示例发布时间:2022-05-22
下一篇:
Java BrowsableEditableData类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap