Skip to content

Commit

Permalink
Merge pull request #337 from IMBlues/development
Browse files Browse the repository at this point in the history
fix: 修复目录创建后默认配置未创建的问题
  • Loading branch information
wklken authored Mar 28, 2022
2 parents af47a83 + 719605b commit 169e853
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/api/bkuser_core/categories/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,25 @@ def create_creator_actions(sender, instance, **kwargs):
logger.info("going to create resource_creator_action for Category<%s>", instance.id)
helper = IAMHelper()
try:
helper.create_creator_actions(kwargs["creator"], instance)
helper.create_creator_actions(kwargs["operator"], instance)
except Exception: # pylint: disable=broad-except
logger.exception(
"failed to create resource_creator_action (category related). [creator=%s, instance=%s]",
"failed to create resource_creator_action (category related). [operator=%s, instance=%s]",
kwargs["creator"],
instance,
)

# 创建目录之后,默认拥有了目录 & 组织的管理能力
try:
helper.create_auth_by_ancestor(
username=kwargs["creator"],
username=kwargs["operator"],
ancestor=instance,
target_type=ResourceType.DEPARTMENT.value,
action_ids=[IAMAction.MANAGE_DEPARTMENT, IAMAction.VIEW_DEPARTMENT],
)
except Exception: # pylint: disable=broad-except
logger.exception(
"failed to create resource_creator_action (department related). [creator=%s, instance=%s]",
kwargs["creator"],
"failed to create resource_creator_action (department related). [operator=%s, instance=%s]",
kwargs["operator"],
instance,
)
1 change: 1 addition & 0 deletions src/api/bkuser_core/categories/plugins/ldap/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

from bkuser_core.categories.plugins.plugin import DataSourcePlugin

from .handlers import * # noqa
from .login import LoginHandler
from .syncer import LDAPSyncer

Expand Down
1 change: 1 addition & 0 deletions src/api/bkuser_core/categories/plugins/local/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"""
from bkuser_core.categories.plugins.plugin import DataSourcePlugin

from .handlers import * # noqa
from .login import LoginHandler
from .syncer import ExcelSyncer

Expand Down
2 changes: 1 addition & 1 deletion src/pages/src/views/catalog/operation/LocalSet.vue
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export default {
const passportRes = await this.$store.dispatch('catalog/ajaxGetPassport', { id: this.catalogInfo.id });
if (passportRes.data.length === 0 && this.catalogInfo.unfilled_namespaces.includes('password')) {
// password 信息未创建
this.passwordInfo = JSON.parse(JSON.stringify(this.$store.state.catalog.defaults.password));
this.passwordInfo = JSON.parse(JSON.stringify(this.$store.state.catalog.defaults.password.default));
this.passwordHasCreated = false;
this.current = 2;
} else {
Expand Down

0 comments on commit 169e853

Please sign in to comment.