summaryrefslogtreecommitdiffstats
path: root/store/sql_channel_store.go
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2016-09-26 13:41:50 -0400
committerHarrison Healey <harrisonmhealey@gmail.com>2016-09-26 13:41:50 -0400
commit667db6e10c7bf4d3856a1f94eaad34d9e03352c1 (patch)
tree44fa38e30a277a11acc51453f1399aa21983e8f8 /store/sql_channel_store.go
parent7fcc004beb9f6ef022f755e8e2f2a958c976c637 (diff)
downloadchat-667db6e10c7bf4d3856a1f94eaad34d9e03352c1.tar.gz
chat-667db6e10c7bf4d3856a1f94eaad34d9e03352c1.tar.bz2
chat-667db6e10c7bf4d3856a1f94eaad34d9e03352c1.zip
Cleaning up some old code from the permissions system change (#4090)
Diffstat (limited to 'store/sql_channel_store.go')
-rw-r--r--store/sql_channel_store.go124
1 files changed, 0 insertions, 124 deletions
diff --git a/store/sql_channel_store.go b/store/sql_channel_store.go
index c0f9bddf0..99a36b1cd 100644
--- a/store/sql_channel_store.go
+++ b/store/sql_channel_store.go
@@ -730,130 +730,6 @@ func (s SqlChannelStore) PermanentDeleteMembersByUser(userId string) StoreChanne
return storeChannel
}
-func (s SqlChannelStore) CheckPermissionsToNoTeam(channelId string, userId string) StoreChannel {
- storeChannel := make(StoreChannel, 1)
-
- go func() {
- result := StoreResult{}
-
- count, err := s.GetReplica().SelectInt(
- `SELECT
- COUNT(0)
- FROM
- Channels,
- ChannelMembers
- WHERE
- Channels.Id = ChannelMembers.ChannelId
- AND Channels.DeleteAt = 0
- AND ChannelMembers.ChannelId = :ChannelId
- AND ChannelMembers.UserId = :UserId`,
- map[string]interface{}{"ChannelId": channelId, "UserId": userId})
- if err != nil {
- result.Err = model.NewLocAppError("SqlChannelStore.CheckPermissionsTo", "store.sql_channel.check_permissions.app_error", nil, "channel_id="+channelId+", user_id="+userId+", "+err.Error())
- } else {
- result.Data = count
- }
-
- storeChannel <- result
- close(storeChannel)
- }()
-
- return storeChannel
-}
-
-func (s SqlChannelStore) CheckPermissionsTo(teamId string, channelId string, userId string) StoreChannel {
- storeChannel := make(StoreChannel, 1)
-
- go func() {
- result := StoreResult{}
-
- count, err := s.GetReplica().SelectInt(
- `SELECT
- COUNT(0)
- FROM
- Channels,
- ChannelMembers
- WHERE
- Channels.Id = ChannelMembers.ChannelId
- AND (Channels.TeamId = :TeamId OR Channels.TeamId = '')
- AND Channels.DeleteAt = 0
- AND ChannelMembers.ChannelId = :ChannelId
- AND ChannelMembers.UserId = :UserId`,
- map[string]interface{}{"TeamId": teamId, "ChannelId": channelId, "UserId": userId})
- if err != nil {
- result.Err = model.NewLocAppError("SqlChannelStore.CheckPermissionsTo", "store.sql_channel.check_permissions.app_error", nil, "channel_id="+channelId+", user_id="+userId+", "+err.Error())
- } else {
- result.Data = count
- }
-
- storeChannel <- result
- close(storeChannel)
- }()
-
- return storeChannel
-}
-
-func (s SqlChannelStore) CheckPermissionsToByName(teamId string, channelName string, userId string) StoreChannel {
- storeChannel := make(StoreChannel, 1)
-
- go func() {
- result := StoreResult{}
-
- channelId, err := s.GetReplica().SelectStr(
- `SELECT
- Channels.Id
- FROM
- Channels,
- ChannelMembers
- WHERE
- Channels.Id = ChannelMembers.ChannelId
- AND (Channels.TeamId = :TeamId OR Channels.TeamId = '')
- AND Channels.Name = :Name
- AND Channels.DeleteAt = 0
- AND ChannelMembers.UserId = :UserId`,
- map[string]interface{}{"TeamId": teamId, "Name": channelName, "UserId": userId})
- if err != nil {
- result.Err = model.NewLocAppError("SqlChannelStore.CheckPermissionsToByName", "store.sql_channel.check_permissions_by_name.app_error", nil, "channel_id="+channelName+", user_id="+userId+", "+err.Error())
- } else {
- result.Data = channelId
- }
-
- storeChannel <- result
- close(storeChannel)
- }()
-
- return storeChannel
-}
-
-func (s SqlChannelStore) CheckOpenChannelPermissions(teamId string, channelId string) StoreChannel {
- storeChannel := make(StoreChannel, 1)
-
- go func() {
- result := StoreResult{}
-
- count, err := s.GetReplica().SelectInt(
- `SELECT
- COUNT(0)
- FROM
- Channels
- WHERE
- Channels.Id = :ChannelId
- AND Channels.TeamId = :TeamId
- AND Channels.Type = :ChannelType`,
- map[string]interface{}{"ChannelId": channelId, "TeamId": teamId, "ChannelType": model.CHANNEL_OPEN})
- if err != nil {
- result.Err = model.NewLocAppError("SqlChannelStore.CheckOpenChannelPermissions", "store.sql_channel.check_open_channel_permissions.app_error", nil, "channel_id="+channelId+", "+err.Error())
- } else {
- result.Data = count
- }
-
- storeChannel <- result
- close(storeChannel)
- }()
-
- return storeChannel
-}
-
func (s SqlChannelStore) SetLastViewedAt(channelId string, userId string, newLastViewedAt int64) StoreChannel {
storeChannel := make(StoreChannel, 1)