forked from p85126437/datagear
完善授权事件处理逻辑
This commit is contained in:
parent
a8c739e1a9
commit
1564a6c1f4
|
@ -242,6 +242,9 @@ public abstract class AbstractMybatisDataPermissionEntityService<ID, T extends D
|
|||
if (!getResourceType().equals(resourceType))
|
||||
return false;
|
||||
|
||||
if (!isPermissionCacheEnabled())
|
||||
return false;
|
||||
|
||||
for (String res : resources)
|
||||
this.permissionCache.evictImmediately(toPermissionCacheKeyOfStr(res));
|
||||
|
||||
|
@ -251,7 +254,7 @@ public abstract class AbstractMybatisDataPermissionEntityService<ID, T extends D
|
|||
@Override
|
||||
public void permissionUpdated()
|
||||
{
|
||||
this.permissionCache.invalidate();
|
||||
permissionCacheInvalidate();
|
||||
}
|
||||
|
||||
protected void setDataFilterParam(Map<String, Object> params, String dataFilter)
|
||||
|
|
|
@ -81,6 +81,7 @@ public class AuthorizationServiceImpl extends AbstractMybatisEntityService<Strin
|
|||
public void add(Authorization entity)
|
||||
{
|
||||
super.add(entity);
|
||||
|
||||
authorizationUpdated(entity.getResourceType(), entity.getResource());
|
||||
}
|
||||
|
||||
|
@ -100,13 +101,12 @@ public class AuthorizationServiceImpl extends AbstractMybatisEntityService<Strin
|
|||
{
|
||||
Authorization authorization = getById(id);
|
||||
|
||||
if (authorization != null)
|
||||
{
|
||||
authorizationUpdated(authorization.getResourceType(), authorization.getResource());
|
||||
return super.deleteById(id);
|
||||
}
|
||||
boolean deleted = (authorization == null ? false : super.deleteById(authorization.getId()));
|
||||
|
||||
return false;
|
||||
if (deleted)
|
||||
authorizationUpdated(authorization.getResourceType(), authorization.getResource());
|
||||
|
||||
return deleted;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue