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

Java IResource类代码示例

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

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



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

示例1: authorize

import org.apache.cassandra.auth.IResource; //导入依赖的package包/类
public Set<Permission> authorize(AuthenticatedUser user, IResource resource) {
 	String uname, rname;
 	access.log(Level.DEBUG,"Authorizing",uname=user.getName(),"for",rname=resource.getName());

 	Set<Permission> permissions;

 	if(user instanceof AAFAuthenticatedUser) {
      AAFAuthenticatedUser aafUser = (AAFAuthenticatedUser) user;
aafUser.setAnonymous(false);

if(aafUser.isLocal()) {
	permissions = checkPermissions(aafUser, new LocalPermission(
		rname.replaceFirst("data", cluster_name)
	));
} else {
  		permissions = checkPermissions(
  				aafUser,
  				perm_type,
  				':'+rname.replaceFirst("data", cluster_name).replace('/', ':'));
}
 	} else {
 		permissions = Permission.NONE;
 	}
 	
 	access.log(Level.INFO,"Permissions on",rname,"for",uname,':', permissions);

     return permissions;
 }
 
开发者ID:att,项目名称:AAF,代码行数:29,代码来源:AAFAuthorizer.java


示例2: maybeCorrectResource

import org.apache.cassandra.auth.IResource; //导入依赖的package包/类
public static IResource maybeCorrectResource(IResource resource, ClientState state) throws InvalidRequestException
{
    if (DataResource.class.isInstance(resource))
    {
        DataResource dataResource = (DataResource) resource;
        if (dataResource.isTableLevel() && dataResource.getKeyspace() == null)
            return DataResource.table(state.getKeyspace(), dataResource.getTable());
    }
    return resource;
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:11,代码来源:AuthorizationStatement.java


示例3: grantStatement

import org.apache.cassandra.auth.IResource; //导入依赖的package包/类
public final GrantStatement grantStatement() throws RecognitionException {
	GrantStatement stmt = null;


	Set<Permission> permissionOrAll1 =null;
	IResource resource2 =null;
	ParserRuleReturnScope username3 =null;

	try {
		// /Users/daidong/Documents/gitrepos/cassandra-trunk/src/java/org/apache/cassandra/cql3/Cql.g:818:5: ( K_GRANT permissionOrAll K_ON resource K_TO username )
		// /Users/daidong/Documents/gitrepos/cassandra-trunk/src/java/org/apache/cassandra/cql3/Cql.g:818:7: K_GRANT permissionOrAll K_ON resource K_TO username
		{
		match(input,K_GRANT,FOLLOW_K_GRANT_in_grantStatement4659); 
		pushFollow(FOLLOW_permissionOrAll_in_grantStatement4671);
		permissionOrAll1=permissionOrAll();
		state._fsp--;

		match(input,K_ON,FOLLOW_K_ON_in_grantStatement4679); 
		pushFollow(FOLLOW_resource_in_grantStatement4691);
		resource2=resource();
		state._fsp--;

		match(input,K_TO,FOLLOW_K_TO_in_grantStatement4699); 
		pushFollow(FOLLOW_username_in_grantStatement4711);
		username3=username();
		state._fsp--;

		 stmt = new GrantStatement(permissionOrAll1, resource2, (username3!=null?input.toString(username3.start,username3.stop):null)); 
		}

	}
	catch (RecognitionException re) {
		reportError(re);
		recover(input,re);
	}
	finally {
		// do for sure before leaving
	}
	return stmt;
}
 
开发者ID:daidong,项目名称:GraphTrek,代码行数:41,代码来源:CqlParser.java


示例4: revokeStatement

import org.apache.cassandra.auth.IResource; //导入依赖的package包/类
public final RevokeStatement revokeStatement() throws RecognitionException {
	RevokeStatement stmt = null;


	Set<Permission> permissionOrAll4 =null;
	IResource resource5 =null;
	ParserRuleReturnScope username6 =null;

	try {
		// /Users/daidong/Documents/gitrepos/cassandra-trunk/src/java/org/apache/cassandra/cql3/Cql.g:831:5: ( K_REVOKE permissionOrAll K_ON resource K_FROM username )
		// /Users/daidong/Documents/gitrepos/cassandra-trunk/src/java/org/apache/cassandra/cql3/Cql.g:831:7: K_REVOKE permissionOrAll K_ON resource K_FROM username
		{
		match(input,K_REVOKE,FOLLOW_K_REVOKE_in_revokeStatement4742); 
		pushFollow(FOLLOW_permissionOrAll_in_revokeStatement4754);
		permissionOrAll4=permissionOrAll();
		state._fsp--;

		match(input,K_ON,FOLLOW_K_ON_in_revokeStatement4762); 
		pushFollow(FOLLOW_resource_in_revokeStatement4774);
		resource5=resource();
		state._fsp--;

		match(input,K_FROM,FOLLOW_K_FROM_in_revokeStatement4782); 
		pushFollow(FOLLOW_username_in_revokeStatement4794);
		username6=username();
		state._fsp--;

		 stmt = new RevokeStatement(permissionOrAll4, resource5, (username6!=null?input.toString(username6.start,username6.stop):null)); 
		}

	}
	catch (RecognitionException re) {
		reportError(re);
		recover(input,re);
	}
	finally {
		// do for sure before leaving
	}
	return stmt;
}
 
开发者ID:daidong,项目名称:GraphTrek,代码行数:41,代码来源:CqlParser.java


示例5: resource

import org.apache.cassandra.auth.IResource; //导入依赖的package包/类
public final IResource resource() throws RecognitionException {
	IResource res = null;


	DataResource r =null;

	try {
		// /Users/daidong/Documents/gitrepos/cassandra-trunk/src/java/org/apache/cassandra/cql3/Cql.g:865:5: (r= dataResource )
		// /Users/daidong/Documents/gitrepos/cassandra-trunk/src/java/org/apache/cassandra/cql3/Cql.g:865:7: r= dataResource
		{
		pushFollow(FOLLOW_dataResource_in_resource5030);
		r=dataResource();
		state._fsp--;

		 res = r; 
		}

	}
	catch (RecognitionException re) {
		reportError(re);
		recover(input,re);
	}
	finally {
		// do for sure before leaving
	}
	return res;
}
 
开发者ID:daidong,项目名称:GraphTrek,代码行数:28,代码来源:CqlParser.java


示例6: resource

import org.apache.cassandra.auth.IResource; //导入依赖的package包/类
public final IResource resource() throws RecognitionException {
    IResource res = null;

    DataResource r = null;


    try {
        // /home/rajatsub/Documents/UIUC/RA/Cassandra/CassandraCodeBase/cassandra-trunk/src/java/org/apache/cassandra/cql3/Cql.g:735:5: (r= dataResource )
        // /home/rajatsub/Documents/UIUC/RA/Cassandra/CassandraCodeBase/cassandra-trunk/src/java/org/apache/cassandra/cql3/Cql.g:735:7: r= dataResource
        {
        pushFollow(FOLLOW_dataResource_in_resource4204);
        r=dataResource();

        state._fsp--;

         res = r; 

        }

    }
    catch (RecognitionException re) {
        reportError(re);
        recover(input,re);
    }
    finally {
    }
    return res;
}
 
开发者ID:rajath26,项目名称:cassandra-trunk,代码行数:29,代码来源:CqlParser.java


示例7: grant

import org.apache.cassandra.auth.IResource; //导入依赖的package包/类
public void grant(AuthenticatedUser performer, Set<Permission> permissions, IResource resource, String to) throws RequestExecutionException {
	access.log(Level.INFO, "Use AAF CLI to grant permission(s) to user/role");
}
 
开发者ID:att,项目名称:AAF,代码行数:4,代码来源:AAFAuthorizer.java


示例8: revoke

import org.apache.cassandra.auth.IResource; //导入依赖的package包/类
public void revoke(AuthenticatedUser performer, Set<Permission> permissions, IResource resource, String from) throws RequestExecutionException {
	access.log(Level.INFO,"Use AAF CLI to revoke permission(s) for user/role");
}
 
开发者ID:att,项目名称:AAF,代码行数:4,代码来源:AAFAuthorizer.java


示例9: list

import org.apache.cassandra.auth.IResource; //导入依赖的package包/类
public Set<PermissionDetails> list(AuthenticatedUser performer, Set<Permission> permissions, IResource resource, String of) throws RequestValidationException, RequestExecutionException {
	access.log(Level.INFO,"Use AAF CLI to find the list of permissions");
	return null;
}
 
开发者ID:att,项目名称:AAF,代码行数:5,代码来源:AAFAuthorizer.java


示例10: revokeAll

import org.apache.cassandra.auth.IResource; //导入依赖的package包/类
public void revokeAll(IResource droppedResource) {
	access.log(Level.INFO,"Use AAF CLI to delete the unused permission", droppedResource.getName());
}
 
开发者ID:att,项目名称:AAF,代码行数:4,代码来源:AAFAuthorizer.java


示例11: test

import org.apache.cassandra.auth.IResource; //导入依赖的package包/类
@Test
public void test() throws Exception {
		Map<String,String> creds = new HashMap<String,String>();
		creds.put("username", "[email protected]");
		creds.put("password", "enc:???");
		AuthenticatedUser aaf = aa.authenticate(creds);

		// Test out "aaf_default_domain
		creds.put("username", "XX");
		aaf = aa.authenticate(creds);
		
		IResource resource = new IResource() {
			public String getName() {
				return "data/authz";
			}

			public IResource getParent() {
				return null;
			}

			public boolean hasParent() {
				return false;
			}

			public boolean exists() {
				return true;
			}
			
		};
		
		Set<Permission> perms = an.authorize(aaf, resource);
		
		// Test out "AAF" access
		creds.put("username", "[email protected]");
		creds.put("password", "enc:???");
		aaf = aa.authenticate(creds);
		perms = an.authorize(aaf, resource);
		Assert.assertFalse(perms.isEmpty());

		perms = an.authorize(aaf, resource);
		Assert.assertFalse(perms.isEmpty());
		
}
 
开发者ID:att,项目名称:AAF,代码行数:44,代码来源:JU_CASS.java


示例12: RevokeStatement

import org.apache.cassandra.auth.IResource; //导入依赖的package包/类
public RevokeStatement(Set<Permission> permissions, IResource resource, String username)
{
    super(permissions, resource, username);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:5,代码来源:RevokeStatement.java


示例13: PermissionAlteringStatement

import org.apache.cassandra.auth.IResource; //导入依赖的package包/类
protected PermissionAlteringStatement(Set<Permission> permissions, IResource resource, String username)
{
    this.permissions = permissions;
    this.resource = (DataResource) resource;
    this.username = username;
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:7,代码来源:PermissionAlteringStatement.java


示例14: GrantStatement

import org.apache.cassandra.auth.IResource; //导入依赖的package包/类
public GrantStatement(Set<Permission> permissions, IResource resource, String username)
{
    super(permissions, resource, username);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:5,代码来源:GrantStatement.java


示例15: RevokePermissionsStatement

import org.apache.cassandra.auth.IResource; //导入依赖的package包/类
public RevokePermissionsStatement(Set<Permission> permissions, IResource resource, RoleName grantee)
{
    super(permissions, resource, grantee);
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:5,代码来源:RevokePermissionsStatement.java


示例16: GrantPermissionsStatement

import org.apache.cassandra.auth.IResource; //导入依赖的package包/类
public GrantPermissionsStatement(Set<Permission> permissions, IResource resource, RoleName grantee)
{
    super(permissions, resource, grantee);
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:5,代码来源:GrantPermissionsStatement.java


示例17: grantStatement

import org.apache.cassandra.auth.IResource; //导入依赖的package包/类
public final GrantStatement grantStatement() throws RecognitionException {
    GrantStatement stmt = null;

    Set<Permission> permissionOrAll1 = null;

    IResource resource2 = null;

    CqlParser.username_return username3 = null;


    try {
        // /home/rajatsub/Documents/UIUC/RA/Cassandra/CassandraCodeBase/cassandra-trunk/src/java/org/apache/cassandra/cql3/Cql.g:688:5: ( K_GRANT permissionOrAll K_ON resource K_TO username )
        // /home/rajatsub/Documents/UIUC/RA/Cassandra/CassandraCodeBase/cassandra-trunk/src/java/org/apache/cassandra/cql3/Cql.g:688:7: K_GRANT permissionOrAll K_ON resource K_TO username
        {
        match(input,K_GRANT,FOLLOW_K_GRANT_in_grantStatement3833); 
        pushFollow(FOLLOW_permissionOrAll_in_grantStatement3845);
        permissionOrAll1=permissionOrAll();

        state._fsp--;

        match(input,K_ON,FOLLOW_K_ON_in_grantStatement3853); 
        pushFollow(FOLLOW_resource_in_grantStatement3865);
        resource2=resource();

        state._fsp--;

        match(input,K_TO,FOLLOW_K_TO_in_grantStatement3873); 
        pushFollow(FOLLOW_username_in_grantStatement3885);
        username3=username();

        state._fsp--;

         stmt = new GrantStatement(permissionOrAll1, resource2, (username3!=null?input.toString(username3.start,username3.stop):null)); 

        }

    }
    catch (RecognitionException re) {
        reportError(re);
        recover(input,re);
    }
    finally {
    }
    return stmt;
}
 
开发者ID:rajath26,项目名称:cassandra-trunk,代码行数:46,代码来源:CqlParser.java


示例18: revokeStatement

import org.apache.cassandra.auth.IResource; //导入依赖的package包/类
public final RevokeStatement revokeStatement() throws RecognitionException {
    RevokeStatement stmt = null;

    Set<Permission> permissionOrAll4 = null;

    IResource resource5 = null;

    CqlParser.username_return username6 = null;


    try {
        // /home/rajatsub/Documents/UIUC/RA/Cassandra/CassandraCodeBase/cassandra-trunk/src/java/org/apache/cassandra/cql3/Cql.g:701:5: ( K_REVOKE permissionOrAll K_ON resource K_FROM username )
        // /home/rajatsub/Documents/UIUC/RA/Cassandra/CassandraCodeBase/cassandra-trunk/src/java/org/apache/cassandra/cql3/Cql.g:701:7: K_REVOKE permissionOrAll K_ON resource K_FROM username
        {
        match(input,K_REVOKE,FOLLOW_K_REVOKE_in_revokeStatement3916); 
        pushFollow(FOLLOW_permissionOrAll_in_revokeStatement3928);
        permissionOrAll4=permissionOrAll();

        state._fsp--;

        match(input,K_ON,FOLLOW_K_ON_in_revokeStatement3936); 
        pushFollow(FOLLOW_resource_in_revokeStatement3948);
        resource5=resource();

        state._fsp--;

        match(input,K_FROM,FOLLOW_K_FROM_in_revokeStatement3956); 
        pushFollow(FOLLOW_username_in_revokeStatement3968);
        username6=username();

        state._fsp--;

         stmt = new RevokeStatement(permissionOrAll4, resource5, (username6!=null?input.toString(username6.start,username6.stop):null)); 

        }

    }
    catch (RecognitionException re) {
        reportError(re);
        recover(input,re);
    }
    finally {
    }
    return stmt;
}
 
开发者ID:rajath26,项目名称:cassandra-trunk,代码行数:46,代码来源:CqlParser.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java UserInformationProto类代码示例发布时间:2022-05-22
下一篇:
Java TaggedProfileTemplateFactoryFinderImpl类代码示例发布时间: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