mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-10 10:15:19 +08:00
Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
4123d47174 | |||
fbdd5a926d |
@ -469,15 +469,25 @@ func GetMaskedApplication(application *Application, userId string) *Application
|
|||||||
application.FailedSigninFrozenTime = DefaultFailedSigninFrozenTime
|
application.FailedSigninFrozenTime = DefaultFailedSigninFrozenTime
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isOrgUser := false
|
||||||
if userId != "" {
|
if userId != "" {
|
||||||
if isUserIdGlobalAdmin(userId) {
|
if isUserIdGlobalAdmin(userId) {
|
||||||
return application
|
return application
|
||||||
}
|
}
|
||||||
|
|
||||||
user, _ := GetUser(userId)
|
user, err := GetUser(userId)
|
||||||
if user != nil && user.IsApplicationAdmin(application) {
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
if user != nil {
|
||||||
|
if user.IsApplicationAdmin(application) {
|
||||||
return application
|
return application
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if user.Owner == application.Organization {
|
||||||
|
isOrgUser = true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
application.ClientSecret = "***"
|
application.ClientSecret = "***"
|
||||||
@ -519,9 +529,12 @@ func GetMaskedApplication(application *Application, userId string) *Application
|
|||||||
application.OrganizationObj.InitScore = -1
|
application.OrganizationObj.InitScore = -1
|
||||||
application.OrganizationObj.EnableSoftDeletion = false
|
application.OrganizationObj.EnableSoftDeletion = false
|
||||||
application.OrganizationObj.IsProfilePublic = false
|
application.OrganizationObj.IsProfilePublic = false
|
||||||
|
|
||||||
|
if !isOrgUser {
|
||||||
application.OrganizationObj.MfaItems = nil
|
application.OrganizationObj.MfaItems = nil
|
||||||
application.OrganizationObj.AccountItems = nil
|
application.OrganizationObj.AccountItems = nil
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return application
|
return application
|
||||||
}
|
}
|
||||||
|
@ -707,6 +707,15 @@ export function goToLinkSoft(ths, link) {
|
|||||||
ths.props.history.push(link);
|
ths.props.history.push(link);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function goToLinkSoftOrJumpSelf(ths, link) {
|
||||||
|
if (link.startsWith("http")) {
|
||||||
|
goToLink(link);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ths.props.history.push(link);
|
||||||
|
}
|
||||||
|
|
||||||
export function showMessage(type, text) {
|
export function showMessage(type, text) {
|
||||||
if (type === "success") {
|
if (type === "success") {
|
||||||
message.success(text);
|
message.success(text);
|
||||||
|
@ -64,7 +64,9 @@ class UserEditPage extends React.Component {
|
|||||||
|
|
||||||
UNSAFE_componentWillMount() {
|
UNSAFE_componentWillMount() {
|
||||||
this.getUser();
|
this.getUser();
|
||||||
|
if (Setting.isLocalAdminUser(this.props.account)) {
|
||||||
this.getOrganizations();
|
this.getOrganizations();
|
||||||
|
}
|
||||||
this.getApplicationsByOrganization(this.state.organizationName);
|
this.getApplicationsByOrganization(this.state.organizationName);
|
||||||
this.getUserApplication();
|
this.getUserApplication();
|
||||||
this.setReturnUrl();
|
this.setReturnUrl();
|
||||||
@ -1001,7 +1003,7 @@ class UserEditPage extends React.Component {
|
|||||||
<div style={{verticalAlign: "middle", marginBottom: 10}}>{`(${i18next.t("general:empty")})`}</div>
|
<div style={{verticalAlign: "middle", marginBottom: 10}}>{`(${i18next.t("general:empty")})`}</div>
|
||||||
</Col>
|
</Col>
|
||||||
}
|
}
|
||||||
<CropperDivModal disabled={disabled} tag={tag} setTitle={set} buttonText={`${title}...`} title={title} user={this.state.user} organization={this.state.organizations.find(organization => organization.name === this.state.organizationName)} />
|
<CropperDivModal disabled={disabled} tag={tag} setTitle={set} buttonText={`${title}...`} title={title} user={this.state.user} organization={this.getUserOrganization()} />
|
||||||
</Col>
|
</Col>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -172,7 +172,7 @@ class AuthCallback extends React.Component {
|
|||||||
Setting.goToLink(`${oAuthParams.redirectUri}${concatChar}${responseType}=${token}&state=${oAuthParams.state}&token_type=bearer`);
|
Setting.goToLink(`${oAuthParams.redirectUri}${concatChar}${responseType}=${token}&state=${oAuthParams.state}&token_type=bearer`);
|
||||||
} else if (responseType === "link") {
|
} else if (responseType === "link") {
|
||||||
const from = innerParams.get("from");
|
const from = innerParams.get("from");
|
||||||
Setting.goToLinkSoft(this, from);
|
Setting.goToLinkSoftOrJumpSelf(this, from);
|
||||||
} else if (responseType === "saml") {
|
} else if (responseType === "saml") {
|
||||||
if (res.data2.method === "POST") {
|
if (res.data2.method === "POST") {
|
||||||
this.setState({
|
this.setState({
|
||||||
|
Reference in New Issue
Block a user