|
|
@@ -12,16 +12,22 @@ import com.uas.platform.b2c.core.config.MessageConf;
|
|
|
import com.uas.platform.b2c.core.support.SystemSession;
|
|
|
import com.uas.platform.core.exception.IllegalOperatorException;
|
|
|
import com.uas.platform.core.exception.SystemException;
|
|
|
+import com.uas.platform.core.model.Constant;
|
|
|
import com.uas.platform.core.model.PageInfo;
|
|
|
import com.uas.platform.core.model.PageParams;
|
|
|
import com.uas.platform.core.util.AgentUtils;
|
|
|
import com.uas.platform.core.util.encry.Md5Utils;
|
|
|
import com.uas.sso.entity.UserView;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.support.ManagedMap;
|
|
|
import org.springframework.data.domain.Page;
|
|
|
import org.springframework.data.jpa.domain.Specification;
|
|
|
+import org.springframework.security.access.ConfigAttribute;
|
|
|
+import org.springframework.security.core.GrantedAuthority;
|
|
|
+import org.springframework.security.core.authority.SimpleGrantedAuthority;
|
|
|
import org.springframework.security.core.userdetails.UsernameNotFoundException;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.ui.ModelMap;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
import com.uas.sso.util.AccountUtils;
|
|
|
@@ -704,4 +710,38 @@ public class UserServiceImpl implements UserService {
|
|
|
Long userUU = SystemSession.getUser().getUserUU();
|
|
|
userDao.updateUserImageUrl(userUU, imageUrl);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public ModelMap anthority(User user,String resUrl) {
|
|
|
+ Set<ResourceItem> resourceItems = new HashSet<>();
|
|
|
+ user.setCurrentEnterpriseRoles();
|
|
|
+ Set<Role> roles = user.getRoles();
|
|
|
+ if (!org.apache.commons.collections.CollectionUtils.isEmpty(roles)) {
|
|
|
+ for (Role role : roles) {
|
|
|
+ resourceItems = role.getResourceItems();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //匹配当前访问权限;
|
|
|
+ if (!org.apache.commons.collections.CollectionUtils.isEmpty(resourceItems)) {
|
|
|
+ for (ResourceItem re : resourceItems) {
|
|
|
+ if (resUrl.equals(re.getUrl())) {
|
|
|
+ ModelMap map = new ModelMap();
|
|
|
+ map.put("status","sucess");
|
|
|
+ map.put("msg",re.getDesc());
|
|
|
+ return map;
|
|
|
+ } else {
|
|
|
+ ModelMap map = new ModelMap();
|
|
|
+ map.put("status","fail");
|
|
|
+ map.put("msg","没有该导出权限,请联系管理员");
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ ModelMap map = new ModelMap();
|
|
|
+ map.put("status","fail");
|
|
|
+ map.put("msg","没有该导出权限,请联系管理员");
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
}
|