Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
crm_uc
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ikcrm_server
crm_uc
Commits
912dc651
Commit
912dc651
authored
Mar 21, 2019
by
houdelin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change userable
parent
26f24a97
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
5 deletions
+36
-5
app/models/concerns/crm_uc/userable.rb
+36
-0
app/models/user.rb
+0
-5
No files found.
app/models/concerns/crm_uc/userable.rb
0 → 100644
View file @
912dc651
module
CrmUc
module
Userable
extend
ActiveSupport
::
Concern
included
do
include
CrmUc
::
UserCenterable
# 如果要判断user是不是独立版用户,请用User#ikcrm_user?方法
enum
user_type:
{
normal_user:
0
,
dingtalk_user:
1
,
kingdee_user:
2
,
wechat_user:
3
,
wx_user:
4
}
enum
status:
[
:hide
,
:visible
]
if
AppSettings
.
uc_enabled?
enum
permission:
[
:deny
,
:edit
,
:show
]
end
default_scope
{
usable
}
scope
:stateless
,
->
{
unscope
(
where:
[
:status
,
:locked_at
,
:usable
])
}
scope
:visible
,
->
{
stateless
.
where
(
status:
statuses
[
:visible
])
}
scope
:usable
,
->
{
if
AppSettings
.
uc_enabled?
where
(
usable:
true
)
else
where
(
status:
statuses
[
:visible
],
locked_at:
nil
)
end
}
end
end
end
app/models/user.rb
deleted
100644 → 0
View file @
26f24a97
class
User
<
ActiveRecord
::
Base
self
.
table_name
=
AppSettings
.
table_name
(
'users'
)
include
CrmUc
::
UserCenterable
end
Write
Preview
Markdown
is supported
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