Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
git test
Jpress
Commits
e28e5d5d
Commit
e28e5d5d
authored
6 years ago
by
fuhai999@gmail.com
Browse files
Options
Download
Email Patches
Plain Diff
v2.0.3
parent
7db4bdca
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
jpress-core/src/main/java/io/jpress/core/addon/controller/AddonControllerManager.java
+5
-0
.../jpress/core/addon/controller/AddonControllerManager.java
jpress-web/src/main/java/io/jpress/web/admin/_PermissionController.java
+11
-1
.../main/java/io/jpress/web/admin/_PermissionController.java
with
16 additions
and
1 deletion
+16
-1
jpress-core/src/main/java/io/jpress/core/addon/controller/AddonControllerManager.java
+
5
-
0
View file @
e28e5d5d
...
...
@@ -69,6 +69,11 @@ public class AddonControllerManager {
controllerAddonMapping
.
put
(
c
,
addonId
);
}
public
static
List
<
String
>
getAllActionKeys
()
{
return
actionMapping
.
getAllActionKeys
();
}
public
static
void
deleteController
(
Class
<?
extends
Controller
>
c
)
{
RequestMapping
mapping
=
c
.
getAnnotation
(
RequestMapping
.
class
);
if
(
mapping
==
null
)
return
;
...
...
This diff is collapsed.
Click to expand it.
jpress-web/src/main/java/io/jpress/web/admin/_PermissionController.java
+
11
-
1
View file @
e28e5d5d
...
...
@@ -21,6 +21,7 @@ import com.jfinal.core.JFinal;
import
com.jfinal.kit.Ret
;
import
io.jboot.web.controller.annotation.RequestMapping
;
import
io.jpress.JPressConsts
;
import
io.jpress.core.addon.controller.AddonControllerManager
;
import
io.jpress.core.annotation.AdminPermission
;
import
io.jpress.core.menu.MenuGroup
;
import
io.jpress.core.menu.MenuItem
;
...
...
@@ -140,14 +141,23 @@ public class _PermissionController extends AdminControllerBase {
*/
private
static
List
<
Permission
>
buildActionPermissions
()
{
List
<
Permission
>
permissions
=
new
ArrayList
<>();
List
<
String
>
allActionKeys
=
JFinal
.
me
().
getAllActionKeys
();
List
<
String
>
allActionKeys
=
AddonControllerManager
.
getAllActionKeys
();
allActionKeys
.
addAll
(
JFinal
.
me
().
getAllActionKeys
());
String
[]
urlPara
=
new
String
[
1
];
for
(
String
actionKey
:
allActionKeys
)
{
// 只处理后台的权限 和 API的权限
if
(
actionKey
.
startsWith
(
"/admin"
)
||
actionKey
.
startsWith
(
"/api"
))
{
Action
action
=
JFinal
.
me
().
getAction
(
actionKey
,
urlPara
);
//去获取 插件的 Action
if
(
action
==
null
){
action
=
AddonControllerManager
.
getAction
(
actionKey
,
urlPara
);
}
if
(
action
==
null
||
excludedMethodName
.
contains
(
action
.
getMethodName
()))
{
continue
;
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment