CK权限管理


CK主要通过users.xml文件做用户权限控制,主要通过用户角色、数据库账号定义、权限管理等来进行控制。

一、用户角色profile

1、重要参数解释

  • profile : 每个profile相当于一个数据库用户角色,方便后续数据库账号授权时进行复用,默认为default,可自定义创建
  • max_memory_usage : 内存使用大小,可通过min、max设置其上下限。
  • distributed_product_mode : 分布式查询模式,默认开启。
  • readonly :读写权限限制。0:不进行任何限制(默认值); 1:只拥有读权限(只能执行 SELECT、 EXISTS、 SHOW 和 DESCRIBE) ; 2:拥有读权限和设置权限(在读权限基础上,增加了 SET查询)。
  • allow ddl : DDL权限。0:不允许 DDL查询; 1: 允许 DDL查询(默认值)。

2、示例

    <!-- Profiles of settings. -->
    <profiles>
        <!-- Default settings. -->
        <default>           <!--默认default角色-->
            <max_memory_usage>10000000000</max_memory_usage>
            <use_uncompressed_cache>0</use_uncompressed_cache>
            <load_balancing>random</load_balancing>
        </default>

    	<rw_role>           <!--超级读写权限角色-->  
	        <distributed_product_mode>allow</distributed_product_mode>
	        <constraints>
		        <max_memory_usage>
		            <min>5000000000</min>
		            <max>20000000000</max>
		        </max_memory_usage>
	        </constraints>

            <readonly>0</readonly>
            <allow_ddl>1</allow_ddl>
	    </rw_role>

        <ro_role>       <!--拥有set权限的读权限角色-->
            <distributed_product_mode>allow</distributed_product_mode>
            <constraints>
                <max_memo
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值