cloudstrg 0.0.11 → 0.0.12
Sign up to get free protection for your applications and to get access to all the features.
- data/app/models/cloudstrg/remoteobject.rb +2 -0
- data/lib/cloudstrg/cloudstrg.rb +18 -1
- data/lib/cloudstrg/cloudstrg.rb~ +21 -3
- data/lib/cloudstrg/version.rb +1 -1
- data/lib/cloudstrg/version.rb~ +1 -1
- metadata +2 -2
data/lib/cloudstrg/cloudstrg.rb
CHANGED
@@ -124,7 +124,9 @@ module CloudStrg
|
|
124
124
|
#
|
125
125
|
# Params: the "params" variable must contain the following fields
|
126
126
|
# share_user: the username which we want the file shared with,
|
127
|
-
# file_id: the id of the file
|
127
|
+
# file_id: the id of the file,
|
128
|
+
# local_file_id: the local id of the file,
|
129
|
+
# user_id: the id of the user we want to grant.
|
128
130
|
#
|
129
131
|
# Returns:
|
130
132
|
# This method returns non-nil data if success.
|
@@ -132,6 +134,21 @@ module CloudStrg
|
|
132
134
|
def share_file params
|
133
135
|
raise NotImplementedError
|
134
136
|
end
|
137
|
+
|
138
|
+
###
|
139
|
+
# This method allows a user to revoke a file's permission to other users.
|
140
|
+
#
|
141
|
+
# Params: the "params" variable must contain the following fields
|
142
|
+
# file_id: the id of the file,
|
143
|
+
# local_file_id: the local id of the file,
|
144
|
+
# user_id: the id of the target user.
|
145
|
+
#
|
146
|
+
# Returns:
|
147
|
+
# This method returns non-nil data if success.
|
148
|
+
#
|
149
|
+
def unshare_file params
|
150
|
+
raise NotImplementedError
|
151
|
+
end
|
135
152
|
|
136
153
|
###
|
137
154
|
# This method check if a referer is valid
|
data/lib/cloudstrg/cloudstrg.rb~
CHANGED
@@ -124,7 +124,9 @@ module CloudStrg
|
|
124
124
|
#
|
125
125
|
# Params: the "params" variable must contain the following fields
|
126
126
|
# share_user: the username which we want the file shared with,
|
127
|
-
# file_id: the id of the file
|
127
|
+
# file_id: the id of the file,
|
128
|
+
# local_file_id: the local id of the file,
|
129
|
+
# user_id: the id of the user we want to grant.
|
128
130
|
#
|
129
131
|
# Returns:
|
130
132
|
# This method returns non-nil data if success.
|
@@ -132,6 +134,22 @@ module CloudStrg
|
|
132
134
|
def share_file params
|
133
135
|
raise NotImplementedError
|
134
136
|
end
|
137
|
+
|
138
|
+
###
|
139
|
+
# This method allows a user to revoke a file's permission to other users.
|
140
|
+
#
|
141
|
+
# Params: the "params" variable must contain the following fields
|
142
|
+
# permission_id: the id of the permission we want to revoke,
|
143
|
+
# file_id: the id of the file,
|
144
|
+
# local_file_id: the local id of the file,
|
145
|
+
# user_id: the id of the target user.
|
146
|
+
#
|
147
|
+
# Returns:
|
148
|
+
# This method returns non-nil data if success.
|
149
|
+
#
|
150
|
+
def unshare_file params
|
151
|
+
raise NotImplementedError
|
152
|
+
end
|
135
153
|
|
136
154
|
###
|
137
155
|
# This method check if a referer is valid
|
@@ -148,12 +166,12 @@ module CloudStrg
|
|
148
166
|
puts plugin_name
|
149
167
|
plugin = Cloudstrg::Cloudstrgplugin.find_by_plugin_name(plugin_name)
|
150
168
|
|
151
|
-
file = Cloudstrg::Remoteobject.where(:user_id => user.id, :cloudstrgplugin_id => plugin, :filename => filename)
|
169
|
+
file = Cloudstrg::Remoteobject.where(:user_id => user.id, :cloudstrgplugin_id => plugin.id, :filename => filename)
|
152
170
|
if not file.empty?
|
153
171
|
file = file[0]
|
154
172
|
file.filehash = filecontent.hash.to_s
|
155
173
|
else
|
156
|
-
file = plugin.remotes.build(:user_id => user, :filename => filename, :filehash => filecontent.hash.to_s, :file_remote_id => file_remote_id)
|
174
|
+
file = plugin.remotes.build(:user_id => user.id, :filename => filename, :filehash => filecontent.hash.to_s, :file_remote_id => file_remote_id)
|
157
175
|
end
|
158
176
|
file.save
|
159
177
|
return file
|
data/lib/cloudstrg/version.rb
CHANGED
data/lib/cloudstrg/version.rb~
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloudstrg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.12
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-03-
|
12
|
+
date: 2013-03-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|